Home  >  Article  >  Backend Development  >  Button permission issues in the management system

Button permission issues in the management system

WBOY
WBOYOriginal
2016-12-01 01:27:242115browse

There is an agent-type management backend with many permission roles and many single-page operation buttons.
Excuse me, a relatively mature approach, how to maintain the relationship between this kind of operation button and permissions?
Display different buttons for different roles.
Never write an if else in the view for each character,

Reply content:

There is an agent-type management backend with many permission roles and many single-page operation buttons.
Excuse me, a relatively mature approach, how to maintain the relationship between this kind of operation button and permissions?
Display different buttons for different roles.
Never write an if else in the view for each character,

You can encapsulate a unified public method to specifically judge permissions. You can refer to this article. There is a section in the article about page operation buttons not being displayed without permission.

You can see http://www.5idev.com/p-php_cl... This link has detailed instructions.

<code>class 子类 extends 父类{
//code
}</code>

For example, in the control layer - the class name is controls.php, and the member page is called memberControl.php. This class can inherit controls.php

controls.php

<code>class controls{
  //code
}</code>

memberControl.php

<code>class memberControl extends controls{
    //code
}</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:mysq transactionNext article:mysq transaction