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

Adding resource based permissions #340

Open
johnbotris opened this issue Nov 12, 2024 · 1 comment
Open

Adding resource based permissions #340

johnbotris opened this issue Nov 12, 2024 · 1 comment

Comments

@johnbotris
Copy link

johnbotris commented Nov 12, 2024

As far as I can tell, the permissions system is purely role-based. For example, if I have a role which gives me the EditMeetingComment permission, then I am capable of editing all meeting comments.

Say a meeting comment should only be editable by the one who made the comment (or to add some complication, it could also be edited by a sysadmin). What would be a good way of extending the project?

Perhaps something like adding ACLs to the User access controller? It's not clear to me when permissions would be added/changed/removed - always at the controller level, or in integration events? I think the latter case could require that you pass around the identity of the user to the actions and events, which seems not ideal.

Any ideas on how to implement this? (Or is it already there and I've totally missed it)

@johnbotris
Copy link
Author

Ah ok upon further digging I see that these are encoded as rules inside the aggregates - the Meetings domain has IMember context which accesses the user id from the IExecutionContextAccessor, and then checks that e.g. the current user is also the one who authored the comment. So mystery solved I guess.

I still wonder how this would work with the case I mentioned where a comment can be edited by either the author or a sysadmin. Or maybe a comment might also be edited by some trigger that's not caused by a user via the API, rather a Cron job or something.

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