Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

require_acl usage

edited August 2013 in Apps

I added a new role (manager) halfway between editor and admin. I've created some new apps with CRUD generator. Now I want to allow managers to access these apps (even from the tools menu).

Have I to create a file /conf/acl.php?

Do I need to replace require_admin with require_acl in every handler (add, admin, delete, edit)?

Thanks for help.

Comments

  • To make an app appear in the Tools menu, it simply needs an [Admin] section in its conf/config.php with handler and name settings:

    [Admin]
    handler = myapp/admin
    name = My App
    

    To limit access to it for certain roles, you would need to create a conf/acl.php which can be as simple as this:

    ; <?php /*
    
    myapp = My App
    
    ; */ ?>
    

    This will add a "My App" checkbox to the roles form, and you can then add it to a require_acl() call like this:

    $this->require_acl ('myapp');
    

    require_admin() is actually just an alias for require_acl('admin'), but you can chain them in require_acl() to require several permissions like this:

    $this->require_acl ('admin', 'myapp');
    

    This says that they must be an admin and also be allowed to access your app.

Sign In or Register to comment.