public QueryRulePack GetQueryRules(string typeName, string roleId) { BasicPermission.AdminRules.AssertAuthorized(); var rules = QueryAuthLogic.GetQueryRules(Lite.ParsePrimaryKey <RoleEntity>(roleId).FillToString(), TypeLogic.GetType(typeName).ToTypeEntity()); CleanChanges(rules); return(rules); }
public JsonNetResult SaveQueries(FormCollection form, string prefix) { Lite <RoleEntity> role = this.ExtractLite <RoleEntity>(TypeContextUtilities.Compose(prefix, "Role")); TypeEntity type = this.ExtractEntity <TypeEntity>(TypeContextUtilities.Compose(prefix, "Type")); var querys = QueryAuthLogic.GetQueryRules(role, type).ApplyChanges(this, prefix); if (querys.HasErrors()) { return(querys.ToJsonModelState()); } QueryAuthLogic.SetQueryRules(querys.Value); return(null); }
public ActionResult Queries(Lite <RoleEntity> role, Lite <TypeEntity> type) { return(this.PopupNavigate(QueryAuthLogic.GetQueryRules(role.FillToString(), type.Retrieve()))); }