Actions
Bug #8919
openAllow specifying custom resource name for authorization purposes from within a plugin/model
Status:
New
Priority:
Normal
Assignee:
-
Category:
Users, Roles and Permissions
Target version:
-
Description
By default when determining the resource_type to be used for a model authorization, the name of the model class is used.
This behaviour is hard to change from within a plugin, as the logic is included in just one method
https://github.com/theforeman/foreman/blob/1.7.1/app/services/authorizer.rb#L115-L127.
My case is the foreman-tasks (http://projects.theforeman.org/issues/4450/) where there is an STI on the task model,
so the default name would be `dynflow_task`, while the desired name is just `task`.
Actions