"403: access denied" when using a new privilege


#1

Hi.

As part of my attempt to create an Items duplicating plugin (Duplicate an Item), I’ve tried to extend the privileges for the Contributor role, like this

public function hookDefineAcl($args)
    {
        $acl = $args['acl'];
        // contributors are able to duplicate
		$acl->allow('contributor', 'Items', 'duplicate');
    }

then adding duplicateAction() functions in both ItemsController.php and AbstractActionController.php files.

It all works fine when I’m logged in as Admin, but when I log in as Contributor I get a 403: Access Denied message everytime I click on my “Duplicate” link.

What am I missing? Anybody could point me in the right direction?

Thanks.


#2

Found the cause: I had mistyped

protected $_hooks = array('define_acl');

writing defineacl instead of the correct name.
Now everything works fine.