5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-02 13:36:09 +00:00

no permitir ingreso hasta que no aceptan la invitación

This commit is contained in:
f 2019-07-10 16:58:06 -03:00
parent 9cf4645d5e
commit cb72082f73
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 9 additions and 5 deletions

View file

@ -14,14 +14,15 @@ class SitePolicy
true
end
# Todes les usuaries pueden ver el sitio
# Todes les usuaries pueden ver el sitio si aceptaron la invitación
def show?
true
!@usuarie.rol_for_site(@site).temporal
end
# Les invitades no pueden generar el sitio
# Les invitades no pueden generar el sitio y les usuaries solo hasta
# que aceptan la invitación
def build?
!site.invitade?(usuarie)
show? && !site.invitade?(usuarie)
end
def send_public_file?

View file

@ -14,7 +14,10 @@
%tr
%td
%h2
= link_to site.name, site_path(site)
- if policy(site).show?
= link_to site.name, site_path(site)
- else
= site.name
- if site.invitade? current_usuarie
%span.badge.badge-warning{data: { toggle: 'tooltip' },
title: t('help.sites.invitade')}