mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add role 'owner' to users (#185)
This commit is contained in:
committed by
GitHub
parent
e86748edca
commit
0e96ff7ad4
@@ -4,7 +4,7 @@ class SiteSettingsController < ApplicationController
|
||||
before_action :authenticate_admin,
|
||||
only: [:general, :boards, :post_statuses, :roadmap, :authentication]
|
||||
|
||||
before_action :authenticate_power_user,
|
||||
before_action :authenticate_moderator,
|
||||
only: [:users]
|
||||
|
||||
def general
|
||||
|
||||
@@ -17,6 +17,9 @@ class UsersController < ApplicationController
|
||||
|
||||
@user.assign_attributes user_update_params
|
||||
|
||||
# Handle special case: trying to set user role to 'owner'
|
||||
raise Pundit::NotAuthorizedError if @user.owner?
|
||||
|
||||
if @user.save
|
||||
render json: @user
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user