Exemplo n.º 1
0
        public static FormLink Secure <T>(this FormLink <T> formLink, UserSecurityContext userSecurityContext)
            where T : class
        {
            if (formLink.ContextId != null)
            {
                return(userSecurityContext.CanAccess <T>(formLink.ContextId.Value)
                                        ? formLink
                                        : formLink.AsText());
            }

            return(userSecurityContext.CanAccess <T>()
                                ? formLink
                                : formLink.AsText());
        }