You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
No
Describe the feature you are requesting, as well as the possible use case(s) for it.
ListPermissionsReq gRPC can list permission for single subject.
This is used to retrieve the users permission in list endpoint.
Because ListPermissionsReq gRPC can list permission only for single subject, we iterate the for users list, this leads to mutiple network calls. Instead if create new gRPC function which can list permissions for mutiple subject, the network call can be reduced.
And the code will be like
if pm.ListPerms && len(usersPage.Clients) > 0 && pm.EntityType != "" && pm.EntityID != "" {
- g, gctx := errgroup.WithContext(ctx)- for i := range usersPage.Clients {- // Copying loop variable "i" to avoid "loop variable captured by func literal"- iter := i- g.Go(func() error {- return svc.retrieveObjectUsersPermissions(gctx, res.GetDomainId(), pm.EntityType, pm.EntityID, &usersPage.Clients[iter])- })- }- if err := g.Wait(); err != nil {- gctx.Done()- return mgclients.ClientsPage{}, err- }+ usersIDs := []string{}+ for _, client := range usersPage.Clients {+ userIDs = append(userIDs, client.ID)+ }++ svc.agent.ListPermissionsOfMutipleSubjects(ctx, &magistrala.ListPermissionsOfMutipleSubjects{+ SubjectType: auth.UserType,+ Subjects: userIDs,+ Object: objectID,+ ObjectType: objectType,+ }
}
Indicate the importance of this feature to you.
Must-have
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
No
Describe the feature you are requesting, as well as the possible use case(s) for it.
ListPermissionsReq
gRPC can list permission for single subject.This is used to retrieve the
users
permission in list endpoint.Because
ListPermissionsReq
gRPC can list permission only for single subject, we iterate the for users list, this leads to mutiple network calls. Instead if create new gRPC function which can list permissions for mutiple subject, the network call can be reduced.And the code will be like
Indicate the importance of this feature to you.
Must-have
Anything else?
No response
The text was updated successfully, but these errors were encountered: