faltaba la politica de permisos para invitadxs
This commit is contained in:
parent
d70eca7149
commit
f69b782c1c
1 changed files with 20 additions and 0 deletions
20
app/policies/invitadx_policy.rb
Normal file
20
app/policies/invitadx_policy.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
class InvitadxPolicy
|
||||
attr_reader :usuarix, :model
|
||||
|
||||
def initialize(usuarix, model)
|
||||
@usuarix = usuarix
|
||||
@model = model
|
||||
end
|
||||
|
||||
def new?
|
||||
create?
|
||||
end
|
||||
|
||||
# Al crear, el modelo recibido es un sitio
|
||||
def create?
|
||||
raise ArgumentError, "#{model.class} must be Site" unless model.class == Site
|
||||
|
||||
# El sitio acepta invitadxs
|
||||
model.invitadxs?
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue