fix: 平台超管可管理后台角色
This commit is contained in:
@@ -959,9 +959,6 @@ func (s *sAdminMember) ClusterSyncSuperAdmin(ctx context.Context, message *gredi
|
||||
// 非超管用户只能操作自己的下级角色用户,并且需要满足自身角色的数据权限设置
|
||||
func (s *sAdminMember) FilterAuthModel(ctx context.Context, memberId int64) *gdb.Model {
|
||||
m := dao.AdminMember.Ctx(ctx)
|
||||
if s.VerifySuperId(ctx, memberId) {
|
||||
return m
|
||||
}
|
||||
|
||||
var roleId int64
|
||||
if contexts.GetUserId(ctx) == memberId {
|
||||
@@ -976,6 +973,10 @@ func (s *sAdminMember) FilterAuthModel(ctx context.Context, memberId int64) *gdb
|
||||
roleId = ro.Int64()
|
||||
}
|
||||
|
||||
if isAdminScopeSuper(ctx, memberId, roleId) {
|
||||
return m
|
||||
}
|
||||
|
||||
roleIds, err := service.AdminRole().GetSubRoleIds(ctx, roleId, false)
|
||||
if err != nil {
|
||||
g.Log().Panicf(ctx, "get the subordinate role permission exception, err:%+v", err)
|
||||
|
||||
Reference in New Issue
Block a user