C# aspboilerplate中的权限管理
我目前正在使用aspboilerplate开发多租户saas webapp,并希望实现权限管理,但我有点困惑 首先,我发现的C# aspboilerplate中的权限管理,c#,asp.net,angular,asp.net-core,aspnetboilerplate,C#,Asp.net,Angular,Asp.net Core,Aspnetboilerplate,我目前正在使用aspboilerplate开发多租户saas webapp,并希望实现权限管理,但我有点困惑 首先,我发现的multi-tenancysides.Host和multi-tenancysides.Tenant有什么区别 其次,[AbpAuthorize]与 [AbpAuthorize(PermissionNames.Pages_Tenants)] 我在活动服务中找到了(和) [AbpAuthorize] 公共类EventAppService:EventCloudAppServi
multi-tenancysides.Host
和multi-tenancysides.Tenant
有什么区别
其次,[AbpAuthorize]
与
[AbpAuthorize(PermissionNames.Pages_Tenants)]
我在活动服务中找到了(和)
[AbpAuthorize]
公共类EventAppService:EventCloudAppServiceBase,IEventAppService
{
私有只读IEventManager\u eventManager;
私有只读IRepository事件存储库;
以及在租户服务中
[AbpAuthorize(PermissionNames.Pages_Tenants)]
public class TenantAppService : AsyncCrudAppService<Tenant, TenantDto, int, PagedResultRequestDto, CreateTenantDto, TenantDto>, ITenantAppService
{
private readonly TenantManager _tenantManager;
[AbpAuthorize(PermissionNames.Pages\u租户)]
公共类租户服务:AsyncCrudAppService、ITenantAppService
{
私有只读租户管理器\u租户管理器;
以下是我希望并期望在我的多租户Saas(Core+Angualr SPA)中实现权限的内容。。。
将有不同的功能(我说是模块),包括事件(CRUD
)、库(CRUD
)、考试(CRUD
)、结果(CRUD
)、出勤(CRUD
)以及我希望对租户超级管理员拥有完全访问(CRUD
)权限(在创建租户时默认分配)然后超级管理员可以创建角色(分配给特定模块的模块和权限(CRUD
)
为了简单起见,如果系统具有考勤模块/功能,则默认情况下,租户的超级管理员将具有完全CRUD
访问权限,而如果员工
角色被创建并限制为CR
,但不允许UD
我已经完成了教程,但无法整理它
多谢各位
首先,multi-tenancysides.Host
和multi-tenancysides.Tenant
之间有什么区别
MultiTenancySides.Host
→ 只能分配给主机用户(user.TenantId==null
)
MultitenacySides.Tenant
→ 只能分配给租户用户(user.TenantId!=null
)
其次,[AbpAuthorize]
与[AbpAuthorize(PermissionNames.Pages\u租户)]
有何不同
[AbpAuthorize]
→ 用户已登录
[AbpAuthorize(PermissionNames.Pages\u租户)]
→ 用户已登录并具有该权限
[AbpAuthorize]
public class EventAppService : EventCloudAppServiceBase, IEventAppService
{
private readonly IEventManager _eventManager;
private readonly IRepository<Event, Guid> _eventRepository;
[AbpAuthorize(PermissionNames.Pages_Tenants)]
public class TenantAppService : AsyncCrudAppService<Tenant, TenantDto, int, PagedResultRequestDto, CreateTenantDto, TenantDto>, ITenantAppService
{
private readonly TenantManager _tenantManager;