mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 06:21:41 +00:00
fix: no hardcodear roles
This commit is contained in:
parent
7a13dffc9b
commit
df8efe800b
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ class UsuariesController < ApplicationController
|
|||
@usuarie = Usuarie.find(params[:usuarie_id])
|
||||
|
||||
if @site.usuaries.count > 1
|
||||
@usuarie.rol_for_site(@site).update_attribute :rol, 'invitade'
|
||||
@usuarie.rol_for_site(@site).update_attribute :rol, Rol::INVITADE
|
||||
else
|
||||
flash[:warning] = I18n.t('usuaries.index.demote.denied')
|
||||
end
|
||||
|
@ -61,7 +61,7 @@ class UsuariesController < ApplicationController
|
|||
authorize SiteUsuarie.new(@site, current_usuarie)
|
||||
|
||||
@usuarie = Usuarie.find(params[:usuarie_id])
|
||||
@usuarie.rol_for_site(@site).update_attribute :rol, 'usuarie'
|
||||
@usuarie.rol_for_site(@site).update_attribute :rol, Rol::USUARIE
|
||||
|
||||
redirect_to site_usuaries_path
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue