Skip to content

Allow to disable local user management #13068

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

Closed
wants to merge 6 commits into from

Conversation

pboguslawski
Copy link
Contributor

This mod introduces parameter DISABLE_LOCAL_USER_MANAGEMENT (false by default) in app.ini [service] section; when true disables local modifications of user data and external sources editor.

This is for scenario when users are synchronized from external source (i.e. LDAP backend configured using gitea cli) and should not be changed locally (only gitea specific user settings are allowed to be changed in gitea). isActive and isAdmin are treated as LDAP data but isRestricted is not (this should be managed in app). More - user is not allowed to remove their account - app admin must do it if required.

Not experienced in gitea devel so please verify and fine tune if required before merging.

Added parameter DISABLE_LOCAL_USER_MANAGEMENT (false by default) in
app.ini [service] section; when true disables local modifications
of username, fullname and e-mail fields in user Settings.

Author-Change-Id: IB#1105051
This patch blocks access to local user management options that
are not required and possibly problematic in scenario when users
are managed in external database (like LDAP) and should not be
managed separately in gitea. Options specific to gitea (like
restricted users) are still managed in this app.

Author-Change-Id: IB#1105051
This fixes external user syncing when local user management is disabled.

Fixes: eca3563
Author-Change-Id: IB#1105051
Hide message about changing username when local user modifications are disabled.

Author-Change-Id: IB#1105051
@lafriks
Copy link
Member

lafriks commented Oct 10, 2020

Imho this should disable changing automatically for LDAP users without special setting. Also restricted setting should be disabled if LDAP filter for it is set, same for admin setting

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 10, 2020
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Oct 10, 2020
Adopted repos screens didn't hide menu tabs. This
mod fixes it and simplifies configuration for templates.
It also removes unnecessarry comment.

Author-Change-Id: IB#1105051
Fixes: eca3563
@stale
Copy link

stale bot commented Dec 25, 2020

This pull request 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 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Dec 25, 2020
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Dec 26, 2020
@stale stale bot removed the issue/stale label Dec 26, 2020
Fixes 500 on organization name change in DISABLE_LOCAL_USER_MANAGEMENT mode.

Fixes: eca3563
Author-Change-Id: IB#1105051
@pboguslawski
Copy link
Contributor Author

Imho this should disable changing automatically for LDAP users without special setting.

This switch disables local user management regardless of how many user backends exist/will exist in the system. This switch disables also local maintenace of local accounts that already exist in the system (admin is still able to remove user accounts - they will be recreated from LDAP for example). This mod is intentionally designed not to relay on specific backends and this should fit well it common internal company environment scenarios (i.e. users in one or a few LDAP, reverse proxy auth, no local user db).

Also restricted setting should be disabled if LDAP filter for it is set, same for admin setting.

This mod assumes, that admin privilege will be maintained in external user db (like LDAP); that's the most common scenario IHMO. Other privileges like "is restricted", "may create git hooks", "may create organizations" are gitea specific and such details maintenance in central LDAP db sounds like overkill. Is one really needs it it the future - may contribute separate mod to specify list of gitea user fields that should be disabled for local changes.

@pboguslawski
Copy link
Contributor Author

Replaced with #18466.

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants