mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
1、全面实现按登录用户动态加载按钮;
2、优化模块授权代码; 3、优化内部功能加载模块的权限控制,比如:拥有模块授权功能的用户给别人授权时,只能访问到自己拥有的模块;
This commit is contained in:
@@ -106,5 +106,17 @@ namespace OpenAuth.App
|
||||
{
|
||||
_repository.Delete(u =>u.Id ==id);
|
||||
}
|
||||
|
||||
public void AssignForRole(int roleId, int[] menuIds)
|
||||
{
|
||||
_relevanceRepository.DeleteBy("RoleElement", roleId);
|
||||
_relevanceRepository.AddRelevance("RoleElement", menuIds.ToLookup(u => roleId));
|
||||
}
|
||||
|
||||
public void AssignForUser(int userId, int[] ids)
|
||||
{
|
||||
_relevanceRepository.DeleteBy("UserElement", userId);
|
||||
_relevanceRepository.AddRelevance("UserElement", ids.ToLookup(u => userId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user