Skip to content

Use user permissions in UI - #1774

Open
CalamityC wants to merge 6 commits into
3.0.0/releasefrom
3.0.0/permissions
Open

CalamityC wants to merge 6 commits into
3.0.0/releasefrom
3.0.0/permissions

Conversation

@CalamityC

@CalamityC CalamityC commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator
  • Added utility function and hook
  • Used it in components to get merged permissions from currentUser and projects

@coveralls

coveralls commented Sep 17, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 93.262%3.0.0/permissions into 3.0.0/release. No base build found for 3.0.0/release.

@jochenklar
jochenklar changed the base branch from 3.0.0/cleanup-v2 to 3.0.0/release September 18, 2026 12:59
@jochenklar jochenklar added this to the RDMO 3.0.0 milestone Sep 18, 2026
@CalamityC
CalamityC marked this pull request as ready for review September 18, 2026 13:18
@@ -0,0 +1,11 @@
export const getEffectivePermissions = (...permissionSets) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is elegant, but a bit hard to get at first, can you add a comment what it does? Also, can we call it combinePermissions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean the exported function? getEffectivePermissions should be named combinePermissions?


import { getEffectivePermissions } from '../../common/utils/permissions'

export const useEffectivePermissions = () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we call this getPermissions? Also, can you add a comment, something like "create a combined set of permissions from the model based permissions for the user and the object based permissions for the project"?

@CalamityC CalamityC Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You mean the file name? So with your comment from above:

import { combinePermissions } from '../../common/utils/getPermissions'

Or do you mean renaming useEffectivePermissions to usePermissions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no combinePermissions in utils, plain usePermissions for the hook (or useCombinedPermissions).

@jochenklar jochenklar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

This branch has not been deployed

No deployments
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.

3 participants