-
Notifications
You must be signed in to change notification settings - Fork 44
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
is_owner condition for custom action #270
Comments
In order to enforce this policy, we'd need to prefetch the subject resource. What do you think about it, @nati? |
I think we should prefetch resource and apply policy for also action. |
Thanks. Ok, prefetch resource is a good option. As far as I can think of, side effect is that, for example, admin action to some users' resource might be prohibited without modifying policy condition to allow tenant_id: <admin_tenant_id> access. |
I think we can check by policy.Check same as checking 'create' policy (line 407-411 in resource_management.go)
Is there a reason that we should use prefetching? |
It is because any action may performed after we crated a resource, and parameters for action won't have a resource information except ID. |
If developers want to restrict using action for some resources to those owner, developers want to write is_owner condition for this custom action policy. However, currently it does not work. This is because owner is checked in GET/PUT/POST/DELETE action by adding tenant_id to (pre)fetch some resource, but there is no this kind of logic in ActionResource.
The text was updated successfully, but these errors were encountered: