Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User count metrics for site roles and special groups #4776

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

labkey-jeckels
Copy link
Contributor

Rationale

Knowing the numbers of users assigned to these site-wide roles and groups will help understand how they are used, and monitor for unusual assignments.

Changes

  • New UsageMetricsProvider to capture user counts in site-wide roles and the special site admin and developer groups
  • Minor code cleanup

Copy link
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm misreading, the metrics provider group handling needs to be adjusted

switch (principal.getPrincipalType())
{
case USER -> count++;
case GROUP -> getAllGroupMembers((Group)principal, MemberType.ACTIVE_USERS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a no-op. Don't you want to do something like count += getAllGroupMembers().size() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

@labkey-jeckels labkey-jeckels merged commit 2979cd8 into develop Sep 26, 2023
3 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_siteRoleAndGroupCounts branch September 26, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants