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

Hide the Delete Facility for user who don't have access to do it #6608

Closed
nihal467 opened this issue Nov 15, 2023 · 9 comments · Fixed by #6953
Closed

Hide the Delete Facility for user who don't have access to do it #6608

nihal467 opened this issue Nov 15, 2023 · 9 comments · Fixed by #6953
Assignees
Labels
good first issue Good for newcomers

Comments

@nihal467
Copy link
Member

Describe the bug

Currently district admin and above have a delete facility button shown in the manage facility dropdown, even though they don't have permission to delete it

To Reproduce
Steps to reproduce the behavior:

  1. Go to any facility
  2. Click on manage facility
  3. See error

Expected behavior

Hide the delete facility button for users, who don't have permission to do it

Screenshots

image

@github-project-automation github-project-automation bot moved this to Triage in Care Nov 15, 2023
@rithviknishad rithviknishad moved this from Triage to Up Next in Care Nov 15, 2023
@rithviknishad rithviknishad added the good first issue Good for newcomers label Nov 15, 2023
@shyamprakash123
Copy link
Contributor

@nihal467 I want to work on this, can I know who don't have access to Delete Facility?

@shyamprakash123
Copy link
Contributor

@nihal467 I want to work on this, can I know who don't have access to Delete Facility?

Can you assign this to me?

@ayush-seth
Copy link

@rithviknishad is this under the same category? Only state admin should see this button?

@rithviknishad
Copy link
Member

Which user can delete is already present in the code base. The issue is about hiding the button instead of keeping it disabled.

image

@xakep8
Copy link
Contributor

xakep8 commented Nov 17, 2023

@rithviknishad I wish to work on this issue can you assign it to me?

@shyamprakash123
Copy link
Contributor

Which user can delete is already present in the code base. The issue is about hiding the button instead of keeping it disabled.

image

Understood, please assign me so that I can start working on this.

@xakep8
Copy link
Contributor

xakep8 commented Nov 20, 2023

@rithviknishad @nihal467 if i am not wrong a district admin must be able to delete the facility if the facility belongs to his district and the stateadmin must only be able to delete a facility if the facility is in his state right?

@rithviknishad
Copy link
Member

Yes, but are you able to even read a facility that's outside of the district admin's district?

If not, why bother defining that no-op check that'd always evaluate to true?

@rithviknishad
Copy link
Member

@xakep8 unassigning as the related PR has not been followed up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
7 participants