Opinion on rbac of Thinkphp

Source: Internet
Author: User
Whether the current operation requires verification. tp provides two parameters in the configuration file, one for storing the operation to be verified, and the other for unverified operations, however, the current operation is used to match with them. if there is no need to verify the operation, add this method.

Today, I read the rbac example in the Thinkphp example, and I will explain the implementation ideas.

1. check whether permission verification is enabled

2. check whether verification is required for the current module.

3. check whether verification is required for the current operation.

4. obtain the permissions of the role to which the user belongs.

5. verify whether the current operation is permitted based on the obtained permissions.

Two questions:

1. whether the current operation requires verification. tp provides two parameters in the configuration file, one for storing the operation to be verified, and the other for unverified operations, however, the current operation is used to match with them. if the add method is included in the operation that does not require verification, the add method of all modules will skip verification.

2. when obtaining permissions of a role, operations on the public module are superimposed on the permission list of the current module, that is, if you add a role to a public module, the ADD operation of the current module will be added whether or not.

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.