Yes. The default canEdit permissions are wildly over permissive for comments (the goal being to match 1.8 behavior for now). To roll those back via the plugin hook means the handler would basically have to run all the tests in ElggEntity::canEdit again, which seems really wasteful.

Maybe canEdit should be stripped down to just triggering the hook. But the core handlers should be static methods on these classes.

On Sep 23, 2013, at 2:42 AM, Juho Jaakkola <notifications@github.com> wrote:

> In engine/classes/ElggComment.php:
> 
> > +	 *
> > +	 * @return bool Whether this comment is editable by the given user.
> > +	 * @see elgg_set_ignore_access()
> > +	 */
> > +	public function canEdit($user_guid = 0) {
> > +		$user_guid = (int)$user_guid;
> > +		$user = get_entity($user_guid);
> > +		if (!$user) {
> > +			$user = elgg_get_logged_in_user_entity();
> > +		}
> > +
> > +		// default is to only allow admins to edit.
> > +		$return = ($user && $user->isAdmin());
> > +
> > +		$params = array('entity' => $this, 'user' => $user);
> > +		return elgg_trigger_plugin_hook('permissions_check', $this->type, $params, $return);
> elgg_trigger_plugin_hook('permissions_check', $this->type, ...) is already included in ElggEntity class. Is there a reason to override canEdit() instead of just registering a plugin hook handler?
> 
> —
> Reply to this email directly or view it on GitHub.