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

[INT-141] [INT-142] User and role management #137

Merged
merged 25 commits into from
Oct 1, 2024
Merged

Conversation

archessmn
Copy link
Member

Add admin pages for managing users and roles.

Features:

  • Edit user roles
  • Create, update and delete roles and their permissions

Copy link
Member

@markspolakovs markspolakovs left a comment

Choose a reason for hiding this comment

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

Looking good! Not done a fully exhaustive review, these are just the first things I spotted.

app/(authenticated)/(superuser)/admin/page.tsx Outdated Show resolved Hide resolved
app/(authenticated)/(superuser)/admin/roles/RoleCard.tsx Outdated Show resolved Hide resolved
lib/search/index.ts Show resolved Hide resolved
lib/auth/permissions.ts Outdated Show resolved Hide resolved
app/(authenticated)/(superuser)/admin/roles/RoleView.tsx Outdated Show resolved Hide resolved
app/(authenticated)/(superuser)/admin/roles/RoleView.tsx Outdated Show resolved Hide resolved
app/(authenticated)/(superuser)/admin/roles/RoleView.tsx Outdated Show resolved Hide resolved
Co-authored-by: Marks Polakovs <[email protected]>
Copy link
Member

@markspolakovs markspolakovs left a comment

Choose a reason for hiding this comment

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

Seems like we as a codebase need to decide where action permissions checks go - the action function or the feature? My preference is for the former as it's easier to tell what permission an action needs.

Otherwise looking good, mainly just error handling.

app/(authenticated)/admin/layout.tsx Outdated Show resolved Hide resolved
app/(authenticated)/admin/positions/actions.ts Outdated Show resolved Hide resolved
app/(authenticated)/admin/roles/page.tsx Outdated Show resolved Hide resolved
app/(authenticated)/admin/users/UserView.tsx Outdated Show resolved Hide resolved
app/(authenticated)/admin/users/UserView.tsx Outdated Show resolved Hide resolved
app/(authenticated)/admin/users/[userID]/AdminUserView.tsx Outdated Show resolved Hide resolved
features/people/roles.ts Outdated Show resolved Hide resolved
@archessmn
Copy link
Member Author

Seems like we as a codebase need to decide where action permissions checks go - the action function or the feature? My preference is for the former as it's easier to tell what permission an action needs.

Having the permissions checks in the features makes sure that checks aren't forgotten when implementing those features in the future, some features are also passed directly from server components without an action wrapper and so the checks are required in the feature.

@jenkins-ystv
Copy link

jenkins-ystv bot commented Sep 23, 2024

Deployed a preview of this PR to https://pr-137-internal.dev.ystv.co.uk

@archessmn archessmn dismissed markspolakovs’s stale review September 30, 2024 14:43

Requested changes have been made

@archessmn archessmn merged commit a17b617 into main Oct 1, 2024
3 checks passed
@archessmn archessmn deleted the user-management branch October 1, 2024 10:27
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