Project

General

Profile

Actions

Bug #11408

closed

Plugin permissions are broken when using multiple selects

Added by Stephen Benjamin over 8 years ago. Updated over 8 years ago.

Status:
Duplicate
Priority:
High
Assignee:
-
Category:
Plugin integration
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 issues 2 (0 open2 closed)

Related to Foreman - Bug #11187: Taxonomy selectors are empty even for users with assign permissionsClosedMarek Hulán07/22/2015Actions
Is duplicate of Foreman - Bug #12118: AssociationAuthorizer should ask model for alternative permission namesClosedStephen Benjamin10/08/2015Actions
Actions #1

Updated by Stephen Benjamin over 8 years ago

  • Related to Bug #11187: Taxonomy selectors are empty even for users with assign permissions added
Actions #2

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_salt/pull/45 added
  • Pull request deleted ()
Actions #3

Updated by Stephen Benjamin over 8 years ago

  • Related to Bug #11409: Removed unused taxonomix mixin added
Actions #4

Updated by Stephen Benjamin over 8 years ago

  • 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.

Actions #5

Updated by Stephen Benjamin over 8 years ago

  • Related to deleted (Bug #11409: Removed unused taxonomix mixin)
Actions #6

Updated by Dominic Cleal over 8 years ago

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.

Actions #7

Updated by Stephen Benjamin over 8 years ago

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.

Actions #8

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_salt/pull/46 added
  • Pull request deleted ()
Actions #9

Updated by Stephen Benjamin over 8 years ago

  • Pull request https://github.com/theforeman/foreman/pull/2619 added
  • Pull request deleted (https://github.com/theforeman/foreman_salt/pull/46)
Actions #10

Updated by Dominic Cleal over 8 years ago

  • Status changed from Ready For Testing to New
  • Pull request added
  • Pull request deleted (https://github.com/theforeman/foreman/pull/2619)
Actions #11

Updated by Stephen Benjamin over 8 years ago

  • Is duplicate of Bug #12118: AssociationAuthorizer should ask model for alternative permission names added
Actions #12

Updated by Stephen Benjamin over 8 years ago

  • Status changed from New to Duplicate

#12118 handles this case

Actions

Also available in: Atom PDF