mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
修改界面,重构授权代码
This commit is contained in:
58
OpenAuth.Domain/Service/SystemAuthService.cs
Normal file
58
OpenAuth.Domain/Service/SystemAuthService.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : OpenAuth.Domain
|
||||
// Author : yubaolee
|
||||
// Created : 04-21-2016
|
||||
//
|
||||
// Last Modified By : yubaolee
|
||||
// Last Modified On : 04-21-2016
|
||||
// Contact : Microsoft
|
||||
// File: AuthenService.cs
|
||||
// ***********************************************************************
|
||||
|
||||
using OpenAuth.Domain.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.Domain.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 领域服务
|
||||
/// <para>超级管理员权限</para>
|
||||
/// </summary>
|
||||
public class SystemAuthService : AuthoriseService
|
||||
{
|
||||
public SystemAuthService(IUnitWork unitWork):base(unitWork)
|
||||
{
|
||||
_user = new User { Account = "System", Id = Guid.Empty };
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override IQueryable<Org> GetOrgsQuery()
|
||||
{
|
||||
return _unitWork.Find<Org>(null);
|
||||
}
|
||||
|
||||
public override IQueryable<Resource> GetResourcesQuery()
|
||||
{
|
||||
return _unitWork.Find<Resource>(null);
|
||||
}
|
||||
|
||||
public override IQueryable<ModuleElement> GetModuleElementsQuery()
|
||||
{
|
||||
return _unitWork.Find<ModuleElement>(null);
|
||||
}
|
||||
|
||||
public override IQueryable<Module> GetModulesQuery()
|
||||
{
|
||||
return _unitWork.Find<Module>(null);
|
||||
}
|
||||
|
||||
public override IQueryable<Role> GetRolesQuery()
|
||||
{
|
||||
//用户角色
|
||||
return _unitWork.Find<Role>(null);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user