private void SetActionPermissionRequirement(string tableName, ActionPermissionOptions tableAction, int[] roleId, bool sysController = false, bool isApi = false) { Arguments = new object[] { new ActionPermissionRequirement() { SysController = sysController, TableAction = tableAction.ToString(), TableName = tableName, IsApi = isApi, RoleIds = roleId } }; }
/// <summary> /// 判断是否有权限 /// </summary> /// <param name="tableName"></param> /// <param name="authName"></param> /// <param name="roleId"></param> /// <returns></returns> public bool ExistsPermissions(string tableName, ActionPermissionOptions actionPermission, int roleId = 0) { return(ExistsPermissions(tableName, actionPermission.ToString(), roleId)); }
private void SetActionPermissionRequirement(string tableName, ActionPermissionOptions tableAction, bool sysController = false, bool isApi = false, int?roleId = null) { SetActionPermissionRequirement(tableName, tableAction, roleId == null ? null : new int[] { (int)roleId }, sysController, isApi); }
public ActionPermissionAttribute(ActionPermissionOptions tableAction, bool isApi = false) : base(typeof(ActionPermissionFilter)) { this.SetActionPermissionRequirement("", tableAction, true, isApi); }
public ActionPermissionAttribute(string tableName, string roleIds, ActionPermissionOptions tableAction, bool sysController = false, bool isApi = false) : base(typeof(ActionPermissionFilter)) { this.SetActionPermissionRequirement(tableName, tableAction, (roleIds ?? "").Split(",").Select(x => x.GetInt()).ToArray(), sysController, isApi); }
public ActionPermissionAttribute(string tableName, ActionPermissionOptions tableAction, bool sysController = false, bool isApi = false) : base(typeof(ActionPermissionFilter)) { this.SetActionPermissionRequirement(tableName, tableAction, sysController, isApi); }
public ApiActionPermissionAttribute(ActionPermissionOptions tableAction) : base(tableAction, true) { }
public ApiActionPermissionAttribute(string tableName, string roleIds, ActionPermissionOptions tableAction, bool sysController = false) : base(tableName, roleIds, tableAction, sysController, true) { }