Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API接口 ---Enforcer::addPermissionForUser('writer', 'articles','edit'); 文档参数有与代码中facde参数不符 #19

Closed
jhz-code opened this issue Jun 1, 2021 · 5 comments · Fixed by #21
Labels
bug Something isn't working released

Comments

@jhz-code
Copy link

jhz-code commented Jun 1, 2021

差了一个action 参数

包中的代码:

  • @method mixed addPermissionForUser(string $username,string $policy) static 为用户或角色添加权限

文档中API 调用:

赋予权限给某个用户或角色:
// to user
Enforcer::addPermissionForUser('eve', 'articles', 'read');
// to role
Enforcer::addPermissionForUser('writer', 'articles','edit');

@jhz-code
Copy link
Author

jhz-code commented Jun 1, 2021

  • @method mixed hasPermissionForUser(string $username,string $policy) static 确定用户是否具有权限

好几个参数都对不上

@hsluoyz
Copy link
Member

hsluoyz commented Jun 1, 2021

@basakest

@jhz-code
Copy link
Author

jhz-code commented Jun 1, 2021

这些方法中 在实际函数中都缺了一个参数

// adds permissions to a user
Enforcer::addPermissionForUser('eve', 'articles', 'read');
Enforcer::deletePermission('articles', 'read'); // returns false if the permission does not exist (aka not affected).
Enforcer::deletePermissionForUser('eve', 'articles', 'read');
Enforcer::hasPermissionForUser('eve', 'articles', 'read'); // true or false

@hsluoyz
Copy link
Member

hsluoyz commented Jun 1, 2021

@techoner

@leeqvip leeqvip added the bug Something isn't working label Jun 2, 2021
leeqvip pushed a commit that referenced this issue Jun 3, 2021
fix: the annotation of Enforcer facade, fix #19
@leeqvip
Copy link
Member

leeqvip commented Jun 3, 2021

🎉 This issue has been resolved in version 1.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants