mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
NOISSUE - Add default members list base query for role management (#2747)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b23a8c20eb
commit
e7032a6313
@@ -852,6 +852,10 @@ func (repo *Repository) RemoveMemberFromAllRoles(ctx context.Context, memberID s
|
||||
return nil
|
||||
}
|
||||
|
||||
func (repo *Repository) SetMemberListBaseQuery(query string) {
|
||||
repo.membersListBaseQuery = query
|
||||
}
|
||||
|
||||
func applyConditions(query string, pageQuery roles.MembersRolePageQuery) string {
|
||||
var whereClause []string
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ func (ram RoleManagerAuthorizationMiddleware) authorizeMembers(ctx context.Conte
|
||||
}
|
||||
return nil
|
||||
|
||||
case policies.ChannelType, policies.GroupType, policies.ClientType:
|
||||
default:
|
||||
for _, member := range members {
|
||||
if err := ram.authz.Authorize(ctx, smqauthz.PolicyReq{
|
||||
Permission: policies.MembershipPermission,
|
||||
@@ -351,7 +351,5 @@ func (ram RoleManagerAuthorizationMiddleware) authorizeMembers(ctx context.Conte
|
||||
}
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
return errors.Wrap(errors.ErrAuthorization, errors.New("unsupported policies type"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user