-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
[RBAC w/ Domain] Checking for an object/action permission in any domain. #304
Comments
@hsluoyz Did this util exist in casbin-golang? I wonder what should I named it. |
@Zxilly I didn't see any util in the casbin-golang that met this criteria. |
Maybe we can add a series of util function, like |
@ShawnPavel And another option is |
@Zxilly I'm not sure how that would help in this use case. They users aren't admins that I'm checking. |
How would this work? |
+1 I need this too |
Its stated here https://casbin.org/docs/en/rbac-with-domains-api#getrolesforuserindomain that its available for node-casbin, but this is not yet available from what I see right now (Unless I am wrong, if so then please forgive me for being blind). if this is not already done and is already at somewhere, I am willing to contribute and add this functionality in. |
Hi @cwkang1998 I think nobody is working on this now. Contribution is welcome! Please make a PR for it. Can you also join our QQ group? https://casbin.org/en/help |
I remember this feature has been supported, see https://casbin.org/docs/en/rbac#use-pattern-matching-in-rbac, I'm not sure whether is correct. We should add this section doc to casbin website. |
Its definitely doable with the current Management API, its just that the simplified API in the RBAC with domain API stated is not there yet hahahaha. |
Sure! |
do we still plan to add |
Thanks for reminding me @Shivansh-yadav13 , I will submit a PR either by tonight or tmr night. |
…omain` as alias to rbac Documentation indicates that there is existance of `getUsersForRoleInDomain` and `getRolesForUserInDomain` api, but it does not yet exists. This commit implements these functions, by aliasing them to existing rbac function that had already cater for domain apis, to increase and improve dev experience. re casbin#304
Documentation indicates that there is existance of `getUsersForRoleInDomain` and `getRolesForUserInDomain` api, but it does not yet exists. This commit implements these functions, by aliasing them to existing rbac function that had already cater for domain apis, to increase and improve dev experience. re casbin#304
I think if we just use |
You can take a look at my PR and see if it resolves the need for this. if not I think we can add this api in, but I feel like the current implementation can already achieve this. |
…#351) Documentation indicates that there is existance of `getUsersForRoleInDomain` and `getRolesForUserInDomain` api, but it does not yet exists. This commit implements these functions, by aliasing them to existing rbac function that had already cater for domain apis, to increase and improve dev experience. re #304
* fix: *matcher result should be boolean or number* for KeyGet2 (#347) * fix: *matcher result should be boolean or number* for KeyGet2 * fix: updated error hint * fix: basic keyGet2 test * fix: basic_keyget2_policy.csv (cherry picked from commit 0257078) Signed-off-by: Zxilly <zhouxinyu1001@gmail.com> * feat(rbac): add `getUsersForRoleInDomain` & `getRolesForUserInDomain` (#351) Documentation indicates that there is existance of `getUsersForRoleInDomain` and `getRolesForUserInDomain` api, but it does not yet exists. This commit implements these functions, by aliasing them to existing rbac function that had already cater for domain apis, to increase and improve dev experience. re #304 (cherry picked from commit 4896ca2) * feat: #357 Support keyMatch5 (#359) (cherry picked from commit e6a6d8a) * test: use new utils Signed-off-by: Zxilly <zhouxinyu1001@gmail.com> Co-authored-by: Shivansh Yadav <yadavshivansh@gmail.com> Co-authored-by: Chen Wen Kang <23054115+cwkang1998@users.noreply.github.com> Co-authored-by: ZCDC_Ren <kuanglong0312@sina.com>
I'm attempting to figure out how to discover if a user has the ability to perform a specific action on an object in any of my domains. Here's basically what I'm working with:
config
policies
I want to check if Alice has the write action on data1 for any domain. What is the best way to do this?
I can do an
enforce
and supply a domain to check if the user has data1 write access, but I can't do it for all domains at once.I have attempted to add a custom domain matching function using the following code, but the
wildCardDomainMatch
doesn't seem to ever be called.initialization
Domain Match Function
The text was updated successfully, but these errors were encountered: