mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:26:22 +00:00
fix: establecer un parámetro por defecto #12754
This commit is contained in:
parent
75c4d3264d
commit
fda1e5b78c
2 changed files with 6 additions and 0 deletions
|
@ -72,6 +72,8 @@ class UsuariesController < ApplicationController
|
|||
site_usuarie = SiteUsuarie.new(@site, current_usuarie)
|
||||
authorize site_usuarie
|
||||
|
||||
params[:invited_as] = Rol::INVITADE unless Rol.role? params[:invited_as]
|
||||
|
||||
@policy = policy(site_usuarie)
|
||||
end
|
||||
|
||||
|
|
|
@ -21,4 +21,8 @@ class Rol < ApplicationRecord
|
|||
def usuarie?
|
||||
rol == USUARIE
|
||||
end
|
||||
|
||||
def self.role?(rol)
|
||||
ROLES.include? rol
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue