xiidea / ezRbac

A simple yet easy to implement Role Based Access Control Library for popular PHP framework Codeigniter
http://xiidea.github.io/ezRbac/
86 stars 39 forks source link

Permission Error #9

Closed siubie closed 10 years ago

siubie commented 10 years ago

Hi guys i create new project with CI then i follow the docs, but when i tried to log in to the app it said "you do not have sufficient permission to access this resource" my default controller is welcome just the default ci controller.

i also log in to acl manager and add full access to controller but unfortunately it still show the same error.

image

This is the user access map after i add access from acl manager

image

ronisaha commented 10 years ago

Sorry for the late answer, and sorry for the inconvenience. After your comments I realized, the documentation is not complete enough to work with. I will update the document soon.

For now I, will try to point you to some direction:

If you see the ez_rbac.php config file you will find

$config['default_access_map'] = array("view", "create", "edit", "delete", "publish");

These are the allowed access names. You can change it as per your need. The action with same name do not required any more code to work. but if you have any other method(obviously you have) then you need to define a public function named access_map in your controller something like bellow:

 public function access_map(){
        return array(
            'index'=>'view',
            'update'=>'edit'
        );
    }

The index of the array is the actual action name, and the value mapped to the access privilege of this library.

If you required any more help, do not hesitate to drop your question. I'll love love to help you out

Thanks.

siubie commented 10 years ago

Ok i get it :D thanks @ronisaha