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

Add conditions to access rules #80

Open
mkrecek234 opened this issue Nov 10, 2021 · 3 comments
Open

Add conditions to access rules #80

mkrecek234 opened this issue Nov 10, 2021 · 3 comments

Comments

@mkrecek234
Copy link
Contributor

mkrecek234 commented Nov 10, 2021

Feature request:
Allow rules to include certain conditions to be applicable, notably for example: make rule applicable if mode entity's field user_id is or is not identical to logged in user_id, pr entity carries a reference to a user group (which is allowed to edit only for example.

Currently commented out.

// Call $app->acl->can('admin'); for example to find out if user is allowed to admin things.

@mvorisek
Copy link
Member

please always provide a link /w and specific hash/version git tag when refering to a code

@mkrecek234
Copy link
Contributor Author

To be more precise what use cases would be helpful for conditions in rules:

  1. Simple: Filter model based on model field (e.g. all customers from Greece)

  2. User-related 1: Filter all customers where customer->creator_id = logged-in user_id

  3. User related 2; All customers where creator_id is also in same team as logged in user id

  4. User related 3: All customers where 1:N model customer_accessusers also includes the logged-in user

@mvorisek
Copy link
Member

  1. ... 4. can be easily added by hooking on the ADD persistence hook as the current Acl impl does.

if you want these conditions saveable as ACL rule, then scope serialization (or some more canonical export) should be implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants