Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Yii RBAC 中,是否可以获得关于有多少用户有权执行 x 的计数信息?
我的意思是,可以编写一种方法:
但是有什么预制的方法可以做到吗?提前感谢您的任何想法。
部分答案。 只检查 Count 应该不难,因为你可以检查 authAssignment 表,也许做一些 SQL 查询,比如:
SELECT COUNT(*) FROM `AuthAssignment` WHERE itemname = 'PermissionXname';
其他事情需要一些思考,但并非不可能,如果我明白了,我会让你知道。
我不确定是否有任何内置方法。