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: #1655 restrict client selection when d admins assign roles #1701

Merged

Conversation

craigyu
Copy link
Collaborator

@craigyu craigyu commented Dec 17, 2024

closes: #1655

If the logged in user is a d-admin only, then show them only the FC they have permissions to add

Just one FC:
image

More than one:
image

Error state:
image

The "request access to it" feature is not implemented as we do not have enough information at the moment.
image

@craigyu craigyu requested a review from ianliuwk1019 December 17, 2024 19:37
@craigyu craigyu self-assigned this Dec 17, 2024
@craigyu craigyu linked an issue Dec 17, 2024 that may be closed by this pull request
4 tasks
Copy link
Collaborator

@ianliuwk1019 ianliuwk1019 left a comment

Choose a reason for hiding this comment

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

Works great!!

@@ -2,6 +2,7 @@ import {
AdminRoleAuthGroup,
type AdminUserAccessResponse,
type FamAuthGrantDto,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unused import.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

man we need a linter installed

fieldId: string;
}>();

const { validate: validateForestClients } = useField(props.fieldId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not really sure how this validate works...
Just curious, how does useField(props.fieldId) know what to validate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's validating the based on the field id provided
in this case it's forestClients inside the validation logic

image

Copy link

Quality Gate Passed Quality Gate passed for 'nr-forests-access-management_admin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@craigyu craigyu merged commit 15983a7 into main Dec 18, 2024
12 of 13 checks passed
@craigyu craigyu deleted the feat/1655-restrict-client-selection-when-d-admins-assign-roles branch December 18, 2024 19:45
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.

Restrict client selection when d-admins assign roles
2 participants