Is there a declarative way to get all of the groups a user leads or manages?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 08:07 AM
Hello Community. I need to find all of the groups that a user manages or leads, including groups of which the user is not a member. I guess it's common for a user to manage a group, but not be a member of the group. An imperative implementation could just iterate over all groups and test if the user is manager or leader, but that seems really inefficient. I'm looking for something declarative like gs.getUser().getMyGroups() which includes groups the user leads or manages but for which the user is not a member. If I have to go imperative, what's the best way to narrow down the number of records I need to check?
Thank you in advance, this community has always been super helpful.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 06:03 AM
Nice clean code. Thank you Hitoshi!