Bug #11408
closed
Plugin permissions are broken when using multiple selects
Added by Stephen Benjamin over 9 years ago.
Updated over 9 years ago.
Category:
Plugin integration
|
Description
In app/helpers/layout_helper.rb, this:
permission = "view_#{klass.to_s.underscore.pluralize}"
causes problems with foreman_salt:
ERF42-5434 [Foreman::Exception]: unknown permission view_foreman_salt/salt_environments
Is it something I'm doing in particular in Salt that's causing this? It worked fine before this change.
- Related to Bug #11187: Taxonomy selectors are empty even for users with assign permissions added
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_salt/pull/45 added
- Pull request deleted (
)
- Related to Bug #11409: Removed unused taxonomix mixin added
- Subject changed from Plugin permissions are broken to Plugin permissions are broken when using multiple selects
- Status changed from Ready For Testing to New
- Pull request added
- Pull request deleted (
https://github.com/theforeman/foreman_salt/pull/45)
Ah, it's not the taxonomix mixin - It's because I'm using multiple_selects which calls this "authorized_assocations" method that had its logic changed.
- Related to deleted (Bug #11409: Removed unused taxonomix mixin)
The idea is that you should probably alias chain the method to insert an appropriate view permission for that model. I've been thinking that it should perhaps have a better API, but I'm not sure what it'd look like.
I could for now, but that doesn't seem ideal, foreman should provide an interface to get the custom permission from the klass.
Even better would be if permissions were DRYer. Magically generating the names doesn't work for plugins, and we already have a lot of this info in action_permission in the controllers, which for the vast majority of them only deal with CRUD and a single model. It'd be better if we'd store all this in one place.
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_salt/pull/46 added
- Pull request deleted (
)
- Pull request https://github.com/theforeman/foreman/pull/2619 added
- Pull request deleted (
https://github.com/theforeman/foreman_salt/pull/46)
- Status changed from Ready For Testing to New
- Pull request added
- Pull request deleted (
https://github.com/theforeman/foreman/pull/2619)
- Is duplicate of Bug #12118: AssociationAuthorizer should ask model for alternative permission names added
- Status changed from New to Duplicate
Also available in: Atom
PDF