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

Question: How to use casbin with default deny rule? #2639

Closed
zzzz0317 opened this issue Jan 22, 2024 · 4 comments
Closed

Question: How to use casbin with default deny rule? #2639

zzzz0317 opened this issue Jan 22, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@zzzz0317
Copy link
Contributor

I created a new organization with some apps. However, I found that I can't create a rule for "app-built-in".
And when I changed the Casbin model to this, all users had all app's permissions.

r = sub, obj, act

[policy_definition]
p = sub, obj, act

[role_definition]
g = _, _
g2 = _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, p.sub) && g2(r.obj, p.obj) && r.act == p.act

image

I hope this system can achieve that users can only log in to "app-built-in" unless explicitly authorized for a specific application.

@casbin-bot
Copy link
Contributor

@casbin-bot casbin-bot added the enhancement New feature or request label Jan 22, 2024
@zzzz0317
Copy link
Contributor Author

I have 3 app in new organization, and 1 app in built-in organization.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 22, 2024

@zzzz0317 users can only log in to "app-built-in" unless explicitly authorized for a specific application. is a wrong concept. This cannot be done. All users for the built-in org (and the app-built-in app) are global admins. Their permissions cannot be restricted by Casbin permission.

See: https://casdoor.org/docs/basic/core-concepts/#how-does-casdoor-manage-itself

@hsluoyz hsluoyz closed this as completed Jan 22, 2024
@hsluoyz hsluoyz added question Further information is requested and removed enhancement New feature or request labels Jan 22, 2024
@zzzz0317
Copy link
Contributor Author

zzzz0317 commented Jan 29, 2024

@hsluoyz My point is that users in the built-in organization are all high-privileged administrators. For users from other organizations, by default, they are only allowed to log in to a few specific applications. If they don't have administrator authorization, a specific role, or are not part of a specific group, they cannot log in to other applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants