Dudu'sArticleI was very excited when I found that application message interception could perform centralized permission verification.
It's a pity that all of you think about it. No one can think of such a great thing.
However, there is another headache for permission allocation.
I can see that someone uses enumeration and then uses a bit to differentiate the permission information. The advantage is that there is little space to avoid overlapping permissions.
Some people also use the enumeration of flags to quickly identify the permission set, which is very nice, but what makes me hesitate is that it can only identify 64 types of permissions. What should I do, it is impossible for other methods to achieve better performance than it (for example, if we use a set of things, I cannot pursue performance here. Imagine if more than half of our methods will use permission verification, so this improvement will be very meaningful ). There are always methods, and people cannot throw their urine.
Now the problem is that the permission for using flags for integer enumeration is very limited (even if it is more than one hundred long), flags can bring absolute performance advantages.
My idea: use multiple enumerations to enumerate different enumerations and use reflection to synchronize enumeration and database.
Next, try to paste the demo.