2017-11-28 23:54:49 +08:00
|
|
|
|
// ***********************************************************************
|
|
|
|
|
// Assembly : OpenAuth.Domain
|
|
|
|
|
// Author : yubaolee
|
|
|
|
|
// Created : 04-21-2016
|
|
|
|
|
//
|
|
|
|
|
// Last Modified By : yubaolee
|
|
|
|
|
// Last Modified On : 04-21-2016
|
|
|
|
|
// Contact : Microsoft
|
|
|
|
|
// File: AuthenService.cs
|
|
|
|
|
// ***********************************************************************
|
|
|
|
|
|
2018-04-07 00:36:26 +08:00
|
|
|
|
using System;
|
2017-11-28 23:54:49 +08:00
|
|
|
|
using System.Linq;
|
2017-11-29 20:49:14 +08:00
|
|
|
|
using OpenAuth.Repository.Domain;
|
2017-11-28 23:54:49 +08:00
|
|
|
|
|
2017-11-29 10:35:25 +08:00
|
|
|
|
namespace OpenAuth.App
|
2017-11-28 23:54:49 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 领域服务
|
|
|
|
|
/// <para>超级管理员权限</para>
|
2018-04-07 00:36:26 +08:00
|
|
|
|
/// <para>todo:超级管理员使用guid.empty为ID,可以根据需要修改</para>
|
2017-11-28 23:54:49 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
public class SystemAuthService : AuthoriseService
|
|
|
|
|
{
|
|
|
|
|
public SystemAuthService()
|
|
|
|
|
{
|
2018-04-07 00:36:26 +08:00
|
|
|
|
_user = new User
|
|
|
|
|
{
|
|
|
|
|
Account = "System",
|
|
|
|
|
Name = "超级管理员",
|
|
|
|
|
Id = Guid.Empty.ToString()
|
|
|
|
|
};
|
2017-11-28 23:54:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-07 00:36:26 +08:00
|
|
|
|
|
2017-11-28 23:54:49 +08:00
|
|
|
|
|
|
|
|
|
public override IQueryable<Org> GetOrgsQuery()
|
|
|
|
|
{
|
2017-11-29 18:26:36 +08:00
|
|
|
|
return UnitWork.Find<Org>(null);
|
2017-11-28 23:54:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IQueryable<Resource> GetResourcesQuery()
|
|
|
|
|
{
|
2017-11-29 18:26:36 +08:00
|
|
|
|
return UnitWork.Find<Resource>(null);
|
2017-11-28 23:54:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IQueryable<ModuleElement> GetModuleElementsQuery()
|
|
|
|
|
{
|
2017-11-29 18:26:36 +08:00
|
|
|
|
return UnitWork.Find<ModuleElement>(null);
|
2017-11-28 23:54:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IQueryable<Module> GetModulesQuery()
|
|
|
|
|
{
|
2017-11-29 18:26:36 +08:00
|
|
|
|
return UnitWork.Find<Module>(null);
|
2017-11-28 23:54:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IQueryable<Role> GetRolesQuery()
|
|
|
|
|
{
|
|
|
|
|
//用户角色
|
2017-11-29 18:26:36 +08:00
|
|
|
|
return UnitWork.Find<Role>(null);
|
2017-11-28 23:54:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|