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
@@ -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