Location: PHPKode > projects > Anahita Social Engine > dependencies/plg_system_socialengine/socialengine/model/person/story/acl.php
<?php

class AnModelPersonStoryAcl extends KObject
{	
	public function canAddComment($viewer, $story, $comment = null)
	{
		return !$viewer->isGuest() && $story->template->isCommentable();
	}
	
	public function canDeleteComment($viewer, $story, $comment)
	{
		return $comment->author->id == $viewer->id || $story->owner->id == $viewer->id;
	}
	
	/**
	 * 
	 * @return 
	 * @param $viewer Object
	 * @param $story Object
	 */
	public function canDelete($viewer, $story)
	{
		return $story->owner->id == $viewer->id || $story->author->id == $viewer->id;
	}	
	
}
Return current item: Anahita Social Engine