Today, when we were working on a new system function permission restriction, I had a new idea. I don't know if it was a shift or not!

Source: Internet
Author: User

Today, when we were working on a new system function permission restriction, I had a new idea. I don't know if it was a shift or not!



1. First define the hexadecimal number with permission limitations, as shown below:

Add Delete modify visiable
0 0 0 0 0 this function is not available
0 0 0 1 1 this function is only available
0 0 1 1 3 this function has modification permission
0 1 1 1 7 this function has been modified, except permission
1 0 0 1 9 this function has a new permission limit
1 0 1 1 11 this function has been added, modification permission limit
1 1 0 1 13 this function has been added, except permission Restriction
1 1 1 15 the function has been modified, deleted, and the permission limit has been added.

2. Permission restriction for Configuration:

Userrole userdepartment function permission
Common User Manager Office F1 11
Common User General Manager Office F2 3
Common User General Manager Office F3 0
............

3. System implementation:
With the login system, you can use the role and department together with the role to obtain all features and permission configurations, and then perform decryption by using the root role (1, get the permission that the user should have!

 In this case, the structure is clear, and the permission restriction part can be established to increase system aggregation. The other problem is that when the system features are added, you need to add the permission restriction configuration!

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.