Permission management. After the requirement is improved, problems occur in implementation.

Source: Internet
Author: User
The system is divided into primary accounts and subaccounts. The original requirement is that the primary account has all permissions, and the subaccount has permissions in groups. Now, the requirement is improved. You must add permissions to the primary account to manage some permissions of the primary account. The subaccount can only manage the permissions of the primary account. I... The system is divided into primary accounts and subaccounts. The original requirement is that the primary account has all permissions, and the subaccount has permissions in groups.

Now the requirement has been improved, requiring you to add permission management for the primary account

  • A primary account has some permissions. a subaccount can only manage the permissions of the primary account.

We have the user_info table and the authorize table.
The user_info table contains all information about the account, including the primary account (identified by the owner_uid and id ).
All permission information is stored in the authrize table.

The sub-account obtains permissions through the group in which the sub-account belongs. The sub-account is identified in another group.
The primary account does not exist in any group. It only logically belongs to the super Administrator group, that is, it is controlled on the program.

The question now is how to control the permissions of the primary account?

The group leader gave a solution by adding two fields in the permission list, is_only/is_deny.
If the is_only field contains the primary account id data, it means that other primary accounts have no permissions.
If the is_deny field contains the primary account id data, other primary accounts have permissions.

Reply content:

The system is divided into primary accounts and subaccounts. The original requirement is that the primary account has all permissions, and the subaccount has permissions in groups.

Now the requirement has been improved, requiring you to add permission management for the primary account

  • A primary account has some permissions. a subaccount can only manage the permissions of the primary account.

We have the user_info table and the authorize table.
The user_info table contains all information about the account, including the primary account (identified by the owner_uid and id ).
All permission information is stored in the authrize table.

The sub-account obtains permissions through the group in which the sub-account belongs. The sub-account is identified in another group.
The primary account does not exist in any group. It only logically belongs to the super Administrator group, that is, it is controlled on the program.

The question now is how to control the permissions of the primary account?

The group leader gave a solution by adding two fields in the permission list, is_only/is_deny.
If the is_only field contains the primary account id data, it means that other primary accounts have no permissions.
If the is_deny field contains the primary account id data, other primary accounts have permissions.

Can I add the group concept to the primary account?
Then, the sub-account group can only have permissions within the Group permission range of the primary account.

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.