Exemple #1
0
        public static bool IsAllowedFor(this Lite <IEntity> lite, TypeAllowedBasic requested)
        {
            TypeAllowedAndConditions tac = GetAllowed(lite.EntityType);

            if (requested <= tac.MinUI())
            {
                return(true);
            }

            if (tac.MaxUI() < requested)
            {
                return(false);
            }

            return(Server.Return((ITypeAuthServer s) => s.IsAllowedForInUserInterface(lite, requested)));
        }
Exemple #2
0
        public static bool IsAllowedFor(this Entity entity, TypeAllowedBasic requested)
        {
            TypeAllowedAndConditions tac = GetAllowed(entity.GetType());

            if (requested <= tac.MinUI())
            {
                return(true);
            }

            if (tac.MaxUI() < requested)
            {
                return(false);
            }

            return(Server.Return((ITypeAuthServer s) => s.IsAllowedForInUserInterface(entity.ToLite(), requested)));
        }