Permission design in system design

Source: Internet
Author: User

In actual system development, the design of functional permissions and personnel permissions is very complex. A long time ago, I saw that the permission design of a system was implemented in multiples of 2. For example, you can add, delete, modify, and query a data, and define its weight limit as 1 (0 power of 2) and 2 (1 power of 2) change to 4 (2 to the power) and query 8 (3 to the power of 2 ). You can combine them when authorizing a person. For example, if his permission code is 9, his permission is addition and query, and 15 hours is addition, deletion, modification, and query, authorization is the addition of the function code, and decoding is the binary bitwise. The function of a module can be split into 12 functions, and the maximum code of a single function is 8191, or if you have all the permissions set to the 12th power of 2, the number obtained when the frontend uses the 12th power of 2 and its permission code is that it has all the permissions.

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.