There is currently a proxy-type Management backend, with many permission roles and a large number of buttons on a single page. How can we maintain the relationship between buttons and permissions? Different buttons are displayed for different roles. Do not say that each role has an I... proxy management background in the view. There are many permission roles, and there are more buttons for single page operations.
How can we maintain the relationship between buttons and permissions?
Different buttons are displayed for different roles.
Never say that if else is in the view for each role,
Reply content:
There is currently a proxy-type Management backend, with many permission roles and a large number of buttons on a single page.
How can we maintain the relationship between buttons and permissions?
Different buttons are displayed for different roles.
Never say that if else is in the view for each role,
A unified public method can be encapsulated to determine permissions. You can refer to the following article. if the page Operation Button is not authorized, the section will not be displayed.
For more information, see http://www.5idev.com/p-php_cl.
Class subclass extends parent class {// code}
For example, in the control layer, the class name is controls. php, and the member page is memberControl. php. this class can inherit controls. php.
Controls. php
Class controls {// code}
MemberControl. php
Class memberControl extends controls {// code}