Skip to content

feat(species): restrict species management to super admins - #1223

Open
mienpham04 wants to merge 1 commit into
Greenstand:masterfrom
mienpham04:species-rebuild
Open

feat(species): restrict species management to super admins#1223
mienpham04 wants to merge 1 commit into
Greenstand:masterfrom
mienpham04:species-rebuild

Conversation

@mienpham04

Copy link
Copy Markdown

Gate the /species route to super admins only via a new isSuperAdmin() helper (checks the global SUPER_PERMISSION policy and no organization scope), so add, edit and delete are limited to super admins. Route-level access is enforced through the disabled flag in Routers.

Also expose loadSpeciesList() from SpeciesContext so add/edit/delete/ combine reload the table after a mutation. The query is disabled by default, so invalidateQueries alone won't refetch it; the missing function previously left the delete/edit dialogs open and unrefreshed.

Description

  • Build Super Admin interface to manage global species
  • Capabilities: Create, edit species (scientific name, common name, etc.)

Issue(s) addressed

What kind of change(s) does this PR introduce?

  • Enhancement
  • Refactor
  • Bug fixes

Please check if the PR fulfils these requirements

  • [ ✓ ] The commit message follows our guidelines
  • [ ✓ ] Tests for the changes have been added (for bug fixes / features)
  • [ ✓ ] Docs have been added / updated (for bug fixes / features)

Issue

What is the current behavior?

What is the new behavior?

  • Create / edit species
  • Maintain canonical dataset (scientific name, common name, etc.)
  • Ensure data consistency

Breaking change

Does this PR introduce a breaking change?
No

Other useful information

…tions

Gate the /species route to super admins only via a new isSuperAdmin()
helper (checks the global SUPER_PERMISSION policy and no organization
scope), so add, edit and delete are limited to super admins. Route-level
access is enforced through the disabled flag in Routers.

Also expose loadSpeciesList() from SpeciesContext so add/edit/delete/
combine reload the table after a mutation. The query is disabled by
default, so invalidateQueries alone won't refetch it; the missing
function previously left the delete/edit dialogs open and unrefreshed.
@sebastiangaertner

Copy link
Copy Markdown

Does that include Keycloak as the permission system?

@mienpham04

Copy link
Copy Markdown
Author

@sebastiangaertner no, this doesn't use Keycloak

@sebastiangaertner

Copy link
Copy Markdown

@dadiorchen do we manage super admin user rights in the admin panel or will this also be handled by keycloak?

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.

Global Species Pool UI (Super Admin)

2 participants