Zend Permission Rbac

For programming and general questions on Zend Framework

Zend Permission Rbac

Postby marc6891 on Wed Feb 14, 2018 3:50 pm

Hi friends,

Recently, I am learning zend framework 3, so I need to help, please. I have read a example docszendframeworkcom/zend-permissions-rbac/ but this example is very short because It don't explain where I can use Rbac, that is to say, I don't know where I have to place the code. Have I write the code in file Module.php? Have I make a class....? I only want to have two role admin and user. I would like to learn how to use it.

Someone can guide me?

Thank very much.
marc6891
 
Posts: 1
Joined: Wed Feb 14, 2018 3:24 pm

Re: Zend Permission Rbac

Postby kian6526 on Sun Feb 18, 2018 11:00 am

You may do it in an action controller, or in the factory of controller include an instance of role object in constructor of controller, or create a service, include the service in constructor of the factory of controller and in that service include role object and related methods to return role object in action controller so by calling the service and its method you access the role object of yours
Good Luck
Kian William
kian6526
 
Posts: 13
Joined: Sun Feb 15, 2015 10:09 am

Re: Zend Permission Rbac

Postby kian6526 on Sun Feb 18, 2018 11:34 am

Also you may give the role in onDispatch event of the controller of yours when a user registers or an admin logs in.
Kian William
kian6526
 
Posts: 13
Joined: Sun Feb 15, 2015 10:09 am


Return to Zend Framework

Who is online

Users browsing this forum: Google [Bot] and 6 guests