Button permissions of the management system

Source: Internet
Author: User
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}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.