Deleting a user belonging to an organization #872

Open
opened 2025-11-02 03:39:50 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @flakron on GitHub (Jul 7, 2017).

  • Gitea version (or commit ref):1.1.2 (but also in master branch)
  • Git version:2.7.4
  • Operating system:Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When I try to delete a user, if that user is a member of an organization then the application won't delete but show an error message, which is fine. But what would be an improvement, is the possibility to show to what organizations/repositories the user is member of, in that case I wouldn't have to go hunting through all organizations to find him/her to be able to remove him/her.

A better solution would probably be to remove him (but first warn that the user belongs to the following organizations: with a list to which ones).

Screenshots

If this issue involves the Web Interface, please include a screenshot

Originally created by @flakron on GitHub (Jul 7, 2017). - Gitea version (or commit ref):1.1.2 (but also in master branch) - Git version:2.7.4 - Operating system:Ubuntu 16.04 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description When I try to delete a user, if that user is a member of an organization then the application won't delete but show an error message, which is fine. But what would be an improvement, is the possibility to show to what organizations/repositories the user is member of, in that case I wouldn't have to go hunting through all organizations to find him/her to be able to remove him/her. A better solution would probably be to remove him (but first warn that the user belongs to the following organizations: with a list to which ones). ## Screenshots **If this issue involves the Web Interface, please include a screenshot**
GiteaMirror added the type/proposalissue/confirmedtype/enhancement labels 2025-11-02 03:39:50 -06:00
Author
Owner

@bkcsoft commented on GitHub (Jul 7, 2017):

Listing the orgas the user is in, with an option to remove the membership on all would be great 👍

The thing to note is that if you're the only owner of an Orga you can't be deleted from it 🙁

@bkcsoft commented on GitHub (Jul 7, 2017): Listing the orgas the user is in, with an option to remove the membership on all would be great 👍 The thing to note is that if you're the only owner of an Orga you can't be deleted from it 🙁
Author
Owner

@glothriel commented on GitHub (Jul 15, 2017):

What I can propose (and try to implement) is the following:
Admin clicks delete button on admin -> user details page
If deleted user has no organization, set flash message and redirect to /admin/users (just as now).
If user has organizations, redirect to a new page that will contain a list of organizations the user belongs to and a message stating that the user will be removed from all those organizations.

@bkcsoft 's note about one-user organization can be solved with removing the organization along with the user.

@glothriel commented on GitHub (Jul 15, 2017): What I can propose (and try to implement) is the following: Admin clicks delete button on `admin -> user details` page If deleted user has no organization, set flash message and redirect to /admin/users (just as now). If user has organizations, redirect to a new page that will contain a list of organizations the user belongs to and a message stating that the user will be removed from all those organizations. @bkcsoft 's note about one-user organization can be solved with removing the organization along with the user.
Author
Owner

@lunny commented on GitHub (Jul 15, 2017):

Since user has a settings page named organizations in v1.2 which will list all of his organizations and leave them. I think maybe it's no need other work. Any idea?

@lunny commented on GitHub (Jul 15, 2017): Since user has a settings page named `organizations` in v1.2 which will list all of his organizations and leave them. I think maybe it's no need other work. Any idea?
Author
Owner

@glothriel commented on GitHub (Jul 15, 2017):

You mean the user settings? Is that still helpful for an admin? Even if it is, clicking through several buttons to delete the user doesn't make a lot of sense if it can be done automatically - unless there is a technical obstacle I'm not aware of.

@glothriel commented on GitHub (Jul 15, 2017): You mean the user settings? Is that still helpful for an admin? Even if it is, clicking through several buttons to delete the user doesn't make a lot of sense if it can be done automatically - unless there is a technical obstacle I'm not aware of.
Author
Owner

@lafriks commented on GitHub (Jul 15, 2017):

@glothriel but not allways user can be removed form the team (especially owners team if he is the only that team)

@lafriks commented on GitHub (Jul 15, 2017): @glothriel but not allways user can be removed form the team (especially owners team if he is the only that team)
Author
Owner

@glothriel commented on GitHub (Jul 15, 2017):

Can't the whole team be removed with the last user?

@glothriel commented on GitHub (Jul 15, 2017): Can't the whole team be removed with the last user?
Author
Owner

@lafriks commented on GitHub (Jul 15, 2017):

Owners team can not be deleted

@lafriks commented on GitHub (Jul 15, 2017): Owners team can not be deleted
Author
Owner

@glothriel commented on GitHub (Jul 16, 2017):

Ok, here's my initial proposition (I will improve the styles to match the application better, treat it as a funcionalty mockup):

image

@glothriel commented on GitHub (Jul 16, 2017): Ok, here's my initial proposition (I will improve the styles to match the application better, treat it as a funcionalty mockup): ![image](https://user-images.githubusercontent.com/4959057/28247225-81d1820a-6a2c-11e7-8982-04b1235414b8.png)
Author
Owner

@lafriks commented on GitHub (Jul 16, 2017):

I think it show warning only where user is only owner. Also option could be added for this situation could possibly allow to specify user to whom ownership should be transfered like changing button "Trasfer ownership and delete". Also it should be modal dialog.

@lafriks commented on GitHub (Jul 16, 2017): I think it show warning only where user is only owner. Also option could be added for this situation could possibly allow to specify user to whom ownership should be transfered like changing button "Trasfer ownership and delete". Also it should be modal dialog.
Author
Owner

@glothriel commented on GitHub (Jul 16, 2017):

I initially wanted to implement it in a dialog (like this one), but I couldn't find anything similiar in the code and decided to go with separate page. If you are aware of such already existing component please direct me.
Transfer ownership and delete is good, but what if the user is only member of the organization? I would not like to go into lot of edge-cases here.

@glothriel commented on GitHub (Jul 16, 2017): I initially wanted to implement it in a dialog (like [this one](http://getbootstrap.com/javascript/#modals)), but I couldn't find anything similiar in the code and decided to go with separate page. If you are aware of such already existing component please direct me. Transfer ownership and delete is good, but what if the user is only member of the organization? I would not like to go into lot of edge-cases here.
Author
Owner

@lafriks commented on GitHub (Jul 16, 2017):

Yes that also, of course

@lafriks commented on GitHub (Jul 16, 2017): Yes that also, of course
Author
Owner

@lafriks commented on GitHub (Jul 16, 2017):

Currently there are no such dialogs but it's content could be filled using vuejs ccomponent with ajax request to get data

@lafriks commented on GitHub (Jul 16, 2017): Currently there are no such dialogs but it's content could be filled using vuejs ccomponent with ajax request to get data
Author
Owner

@stale[bot] commented on GitHub (Feb 13, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 13, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#872