5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 09:51:41 +00:00

faltaba la politica de permisos para invitadxs

This commit is contained in:
f 2019-02-11 16:14:55 -03:00
parent d70eca7149
commit f69b782c1c
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View 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