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

V15: Current User Group Id Condition #18011

Merged
merged 14 commits into from
Jan 17, 2025

Conversation

iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Jan 16, 2025

Description

Adds a grant/deny type condition to check for the current user's user group id's.

Usage:

"conditions": [
  {
    "alias": "Umb.Condition.CurrentUser.GroupId",
    "match": "e5e7f6c8-7f9c-4b5b-8d5d-9e1e5a4f7e4d",
    // "oneOf": ["guid1", "guid2"],
    // "allOf": ["guid1", "guid2"],
    // "noneOf": ["guid1"]
  }
]

To accomplish this, a Set of user group IDs has also been added to the current user model in the Management API. They were already present on the user factory, so linking the properties up works.

@iOvergaard iOvergaard marked this pull request as ready for review January 16, 2025 21:30
@nielslyngsoe nielslyngsoe self-requested a review January 17, 2025 07:11
@nielslyngsoe nielslyngsoe self-assigned this Jan 17, 2025
@nielslyngsoe
Copy link
Member

I shared a few thoughts on the config options to Jacob in a Slack message. So we have a conversation going and why i assigned my self as the reviewer :-)

@iOvergaard iOvergaard changed the title V15: Current User Group Condition V15: Current User Group Id Condition Jan 17, 2025
@iOvergaard iOvergaard enabled auto-merge (squash) January 17, 2025 10:43
Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

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

Good, we could use a unit-test for this, but in relation to all the things we still havn't tested I accept it :-)

@iOvergaard iOvergaard merged commit cd5470f into v15/dev Jan 17, 2025
29 checks passed
@iOvergaard iOvergaard deleted the v15/feature/current-user-group-condition branch January 17, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants