Add role 'owner' to users (#185)

This commit is contained in:
Riccardo Graziosi
2023-01-18 21:11:27 +01:00
committed by GitHub
parent e86748edca
commit 0e96ff7ad4
25 changed files with 482 additions and 54 deletions

View File

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