public PropertyRulePack GetPropertyRule(string typeName, string roleId)
        {
            BasicPermission.AdminRules.AssertAuthorized();
            var rules = PropertyAuthLogic.GetPropertyRules(Lite.ParsePrimaryKey <RoleEntity>(roleId).FillToString(), TypeLogic.GetType(typeName).ToTypeEntity());

            CleanChanges(rules);
            return(rules);
        }
Esempio n. 2
0
        public ActionResult SaveProperties(FormCollection form, string prefix)
        {
            Lite <RoleEntity> role = this.ExtractLite <RoleEntity>(TypeContextUtilities.Compose(prefix, "Role"));
            TypeEntity        type = this.ExtractEntity <TypeEntity>(TypeContextUtilities.Compose(prefix, "Type"));

            var prp = PropertyAuthLogic.GetPropertyRules(role, type).ApplyChanges(this, prefix);

            PropertyAuthLogic.SetPropertyRules(prp.Value);

            if (prp.HasErrors())
            {
                return(prp.ToJsonModelState());
            }

            return(null);
        }
Esempio n. 3
0
 public ActionResult Properties(Lite <RoleEntity> role, Lite <TypeEntity> type)
 {
     return(this.PopupNavigate(PropertyAuthLogic.GetPropertyRules(role.FillToString(), type.Retrieve())));
 }