mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-15 20:54:03 +00:00
Fix authorization of adding/removing users from roles
Only organizers should be able to add/remove users from all roles. Only organizers should be able to edit/update the description of roles of their conference. Cfp/info_desk/voluters coordinators should be to able to add/remove users only to their own teams.
This commit is contained in:
parent
ab339fadb0
commit
03fcdecdf2
3 changed files with 25 additions and 46 deletions
|
|
@ -2,11 +2,13 @@ module Admin
|
|||
class RolesController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
before_action :set_selection
|
||||
authorize_resource :role, except: :index
|
||||
# Show flash message with ajax calls
|
||||
after_action :prepare_unobtrusive_flash, only: :toggle_user
|
||||
|
||||
def index
|
||||
@roles = Role.where(resource: @conference)
|
||||
authorize! :index, @role
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue