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

Bug Report:- Super admin cannot remove admin even after changing the role. #1017

Closed
skbhagat0502 opened this issue Oct 31, 2023 · 20 comments
Closed
Assignees
Labels
bug Something isn't working feature request no-issue-activity No issue activity

Comments

@skbhagat0502
Copy link
Contributor

Describe the bug
I am the super admin and I tried to remove a superadmin from the organisation but it says "current admin cannot remove another admin". If this is the case then why I am able to change the role of that super admin. Ok let say I changed one of the super admin from super admin to user then I should be able to delete the user but not I am getting the same error still.

To Reproduce
Steps to reproduce the behavior:

  1. Login with a super admin account.
    2.Try to remove a admin or a super admin. You see that you are not able to remove.
    3.Change the role of the admin or super admin. Now again try to remove you will see you still are not able to remove.

Expected behavior
There should be clarity, who can change the role and who can delete others. Like I think that a super admin should be able to delete a admin but can't. Even after changing the role.
Also If super admins can delete super admin then I think super admin should also be not able to change the role of a super admin.
More on that If I changed the role of an admin to user then why I am not able to delete the admin. Since changing the role should update the database and now the admin(now user) shoud. I think a clear flow is needed. I have added a video showing the issue.
Actual behavior
A clear and concise description of how the code performed w.r.t expectations.

Screenshots

2023-11-01.00-15-38.mp4

Additional details
Add any other context or screenshots about the feature request here.

Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship PalisadoesFoundation/talawa#359

@skbhagat0502 skbhagat0502 added the bug Something isn't working label Oct 31, 2023
@skbhagat0502
Copy link
Contributor Author

@palisadoes Please assign me this issue. Also I need a clarity that how the flow should be. Who can remove whom and who can change the roles of other. Also one more thing I saw that the pop up do not have the role of super admin even if the currect user is a super admin.

image

image

Also the role is not updated in the popup and the page both if I change the role.

@palisadoes
Copy link
Contributor

Admins should be able to remove all users , however there must be at least one admin per organization.

@skbhagat0502
Copy link
Contributor Author

Admins should be able to remove all users , however there must be at least one admin per organization.

@palisadoes, will admins be able to change the role of another admin? Also will super admin be able to change the role of another super admin? Please tell me. Because this is very important to know. If any one can't remove others but able to change the role then also after changing the role they can remove the user.

@skbhagat0502
Copy link
Contributor Author

I am writing here the overall flow that I have understood.

1). The super admin can't remove another super admin and can't change the role also.
2).The super admin can remove admins and users.
3).The admins can't remove another admin and super admin.
4).The admin can remove users.
5). Users can't do anything like changing role or removing others.
6).The super admin can change the role of admins and users.
7).The admin can change the role of the users.

@skbhagat0502
Copy link
Contributor Author

I am writing here the overall flow that I have understood.

1). The super admin can't remove another super admin and can't change the role also. 2).The super admin can remove admins and users. 3).The admins can't remove another admin and super admin. 4).The admin can remove users. 5). Users can't do anything like changing role or removing others. 6).The super admin can change the role of admins and users. 7).The admin can change the role of the users.

Please tell me the flow in detail so that I can implement it.

@rishav-jha-mech
Copy link
Contributor

@kb-0311, an admin cannot change the role or remove any other admin right ?

@kb-0311
Copy link
Contributor

kb-0311 commented Nov 8, 2023

I am writing here the overall flow that I have understood.

1). The super admin can't remove another super admin and can't change the role also. 2).The super admin can remove admins and users. 3).The admins can't remove another admin and super admin. 4).The admin can remove users. 5). Users can't do anything like changing role or removing others. 6).The super admin can change the role of admins and users. 7).The admin can change the role of the users.

Yes, this is exactly correct. Even I struggled a bit with the lack of application clarification in my GSoC project regarding these edge cases which is why some of them had been unhandled.

The main idea is that there is a particular hierarchy of the user types where the user of a given user type in the hierarchy cannot mutate(remove or change roles of) someone with an equal or higher hierarchy than them. However, they can mutate someone lower than them. The hierarchy of user types :

  1. Super admin
  2. Admin
  3. User

You will need to make these changes in the talawa- API. Could you create an issue and submit a PR? If you are stuck anywhere you can tag me in that PR and I will take a look : )

@skbhagat0502
Copy link
Contributor Author

skbhagat0502 commented Nov 8, 2023

@kb-0311 I understand the hierarchy now, and I'll create an issue for the talawa API to address these edge cases. Rest assured, I'll work on the PR and reach out if I encounter any challenges. Additionally, I'll handle the necessary updates in the talawa admin also.

@skbhagat0502
Copy link
Contributor Author

skbhagat0502 commented Nov 12, 2023

@palisadoes I am working on the backend part of this issue. I will need the new frontend design of the user's page that will solve the issue of showing the organization and user's role in that organization together.
Since it will be a breaking change I will need to test it together with frontend and backend.

@palisadoes
Copy link
Contributor

Thanks. @rishav-jha-mech is working on the frontend layouts with @aashimawadhwa

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Nov 25, 2023
@noman2002
Copy link
Member

@skbhagat0502 Are you still working on this ?

@skbhagat0502
Copy link
Contributor Author

@noman2002 this issue requires the design for the page to proceed. @palisadoes has said that @rishav-jha-mech and @aashimawadhwa is working on the design. So for that It is in hold. You can unassign me this issue if you think there is problem to assign different issue to me as per the policy. Because this issue requires the design for the page and I am waiting for the design.

@noman2002
Copy link
Member

@skbhagat0502 Okay

@skbhagat0502
Copy link
Contributor Author

@noman2002 Please assign this issue to yourself. Once the design is ready you may re assign it to me.

@github-actions github-actions bot removed the no-issue-activity No issue activity label Dec 5, 2023
Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Dec 15, 2023
@github-actions github-actions bot removed the no-issue-activity No issue activity label Dec 24, 2023
Copy link

github-actions bot commented Jan 8, 2024

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Jan 8, 2024
@palisadoes
Copy link
Contributor

@rishav-jha-mech @aashimawadhwa have new screens been created for this?

@github-actions github-actions bot removed the no-issue-activity No issue activity label Jan 10, 2024
Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Jan 21, 2024
@palisadoes
Copy link
Contributor

Closing. This functionality is changing.

@palisadoes palisadoes closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request no-issue-activity No issue activity
Projects
None yet
Development

No branches or pull requests

5 participants