Home > Backend Development > PHP Tutorial > Button permission issues in the management system

Button permission issues in the management system

WBOY
Release: 2023-03-02 10:36:02
Original
2139 people have browsed it

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>
Copy after login

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>
Copy after login

memberControl.php

<code>class memberControl extends controls{
    //code
}</code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template