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

Improve authz error messaging for protected licenses #861

Open
ezekg opened this issue Jul 5, 2024 · 0 comments
Open

Improve authz error messaging for protected licenses #861

ezekg opened this issue Jul 5, 2024 · 0 comments

Comments

@ezekg
Copy link
Member

ezekg commented Jul 5, 2024

For example, this should use a specific deny! message, and also use allow!, instead of being implicit with a boolean:

def check_out?
verify_permissions!('license.check-out')
verify_environment!
case bearer
in role: Role(:admin | :developer | :sales_agent | :support_agent | :environment)
allow!
in role: Role(:product) if record.product == bearer
allow!
in role: Role(:user) if record.owner == bearer || bearer.licenses.exists?(record.id)
!record.protected?
in role: Role(:license) if record == bearer
allow!
else
deny!
end
end

Referring to line 100 above.

@ezekg ezekg changed the title Improve error messaging for protected licenses Improve authz error messaging for protected licenses Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant