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

feat: permissions check for cross space reference editor [FUS-115] #1818

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

marcolink
Copy link
Member

Description

Checks permission when rendering to the Reference Editor. This check exists on the service, but we also want to check for access in the frontend for better UX. The same logic exists for "normal" same space entries.

@marcolink marcolink requested a review from a team January 8, 2025 14:46
@marcolink marcolink marked this pull request as ready for review January 8, 2025 15:45
@marcolink marcolink requested a review from a team as a code owner January 8, 2025 15:45
@@ -17,10 +18,18 @@ export function SingleResourceReferenceEditor(
}
) {
const { dialogs, field } = props.sdk;

const editorPermissions = useEditorPermissions({
Copy link
Contributor

Choose a reason for hiding this comment

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

we could move useEditorPermissions inside of useResourceLinkActions as it's the same for single nad multiple resources :)

  • NIT: instead of passing all props down, just provide the necessary ones :)

Copy link
Member Author

Choose a reason for hiding this comment

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

@chrishelgert I wasn't sure where else this is used, changed it 👍

@marcolink marcolink force-pushed the feat/FUS-115-reference-editor-permissions branch from d0855f8 to 8cb3708 Compare January 9, 2025 12:44
@marcolink marcolink requested a review from chrishelgert January 9, 2025 12:44
@marcolink
Copy link
Member Author

I completely removed the apiUrl prop as this is not used anywhere

@marcolink marcolink force-pushed the feat/FUS-115-reference-editor-permissions branch from 8cb3708 to 7c95720 Compare January 9, 2025 13:01
Copy link
Contributor

@chrishelgert chrishelgert left a comment

Choose a reason for hiding this comment

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

🥇

@chrishelgert
Copy link
Contributor

BTW do you plan to have the checks in RichText editor too?

Copy link
Contributor

@Cyberxon Cyberxon left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@marcolink marcolink merged commit c6783b9 into master Jan 9, 2025
16 checks passed
@marcolink marcolink deleted the feat/FUS-115-reference-editor-permissions branch January 9, 2025 14:12
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