/// <summary> /// 角色权限筛选 /// </summary> /// <param name="filter">筛选信息</param> /// <returns></returns> IQuery CreateAuthorityQueryObject(RoleAuthorityFilterDto filter) { if (filter == null) { return(null); } IQuery query = CreateAuthorityQueryObject(filter, true) ?? QueryFactory.Create <AuthorityQuery>(); #region 角色授权筛选 if (filter.RoleFilter != null) { IQuery roleFilter = this.Instance <IRoleBusiness>().CreateQueryObject(filter.RoleFilter); if (roleFilter != null) { roleFilter.AddQueryFields <RoleQuery>(c => c.SysNo); IQuery roleBindAuthQuery = QueryFactory.Create <RoleAuthorizeQuery>(); roleBindAuthQuery.And <RoleAuthorizeQuery>(c => c.Role, CriteriaOperator.In, roleFilter); roleBindAuthQuery.AddQueryFields <RoleAuthorizeQuery>(c => c.Authority); query.And <AuthorityQuery>(c => c.Code, CriteriaOperator.In, roleBindAuthQuery); } } #endregion return(query); }
/// <summary> /// 角色权限筛选 /// </summary> /// <param name="filter">筛选信息</param> /// <returns></returns> IQuery CreateRoleAuthorityQueryObject(RoleAuthorityFilterDto filter) { if (filter == null) { return(null); } IQuery authQuery = CreateAuthorityQueryObject(filter, true) ?? QueryManager.Create <AuthorityQuery>();//权限筛选 #region 角色筛选 if (filter.RoleFilter != null) { IQuery roleFilter = this.Instance <IRoleBusiness>().CreateQueryObject(filter.RoleFilter); if (roleFilter != null) { IQuery roleBindAuthQuery = QueryManager.Create <RoleAuthorizeQuery>(); //角色&权限绑定 roleBindAuthQuery.EqualInnerJoin(roleFilter); //角色&权限绑定->角色筛选 authQuery.EqualInnerJoin(roleBindAuthQuery); //权限筛选->角色&权限绑定 } } #endregion return(authQuery); }
public ActionResult SearchRoleAuthority(RoleAuthorityFilterDto filter) { return(SearchAuthority(filter)); }