mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 08:51:42 +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])
|
@usuarie = Usuarie.find(params[:usuarie_id])
|
||||||
|
|
||||||
if @site.usuaries.count > 1
|
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
|
else
|
||||||
flash[:warning] = I18n.t('usuaries.index.demote.denied')
|
flash[:warning] = I18n.t('usuaries.index.demote.denied')
|
||||||
end
|
end
|
||||||
|
@ -61,7 +61,7 @@ class UsuariesController < ApplicationController
|
||||||
authorize SiteUsuarie.new(@site, current_usuarie)
|
authorize SiteUsuarie.new(@site, current_usuarie)
|
||||||
|
|
||||||
@usuarie = Usuarie.find(params[:usuarie_id])
|
@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
|
redirect_to site_usuaries_path
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue