[PR #21679] [CLOSED] Fix: new Environment variable OAUTH_DEFAULT_GROUP_PERMISSIONS & default Group behavior of {"config": {"share": False}} for sharing when new group created via oAuth #41829

Closed
opened 2026-04-25 13:56:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21679
Author: @antpar-rf
Created: 2/21/2026
Status: Closed

Base: devHead: dev


📝 Commits (4)

  • 3c7863f Added OAUTH_DEFAULT_GROUP_PERMISSIONS Env Var
  • 32ed90b Fix: Add Oauth Group Permission logic based off of permissions
  • 2acff6f Update oauth.py
  • c710f7a Re-added OAUTH_MAX_SESSIONS_PER_USER

📊 Changes

2 files changed (+33 additions, -1 deletions)

View changed files

📝 backend/open_webui/config.py (+5 -0)
📝 backend/open_webui/utils/oauth.py (+28 -1)

📄 Description

Fix: OAUTH_DEFAULT_GROUP_PERMISSIONS

Add oAuth Group Permission logic for new groups based off of permissions environment model by default . If not set, sets to noone as best form of secops.

OAUTH_DEFAULT_GROUP_PERMISSIONS = 'members' , 'noone' or 'anyone'

            group_data_payload = {}
            oauth_default_permission = (
                auth_manager_config.OAUTH_DEFAULT_GROUP_PERMISSIONS
            )

            if oauth_default_permission:
                if oauth_default_permission.lower() == "members":
                    group_data_payload = {"config": {"share": "members"}}
                elif oauth_default_permission.lower() == "noone":
                    group_data_payload = {"config": {"share": False}}
                elif oauth_default_permission.lower() == "anyone":
                    group_data_payload = {"config": {"share": True}}
                else:
                    log.warning(
                        f"Unknown OAUTH_DEFAULT_GROUP_PERMISSIONS value: {oauth_default_permission}. "
                        "Using empty data payload."
                    )
                    group_data_payload = {"config": {"share": False}}

            log.debug(
                f"Group data payload for OAuth group creation: {group_data_payload}"
            )

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/21679 **Author:** [@antpar-rf](https://github.com/antpar-rf) **Created:** 2/21/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (4) - [`3c7863f`](https://github.com/open-webui/open-webui/commit/3c7863f08d8d737d10aa03b604f7a20bfedd8142) Added OAUTH_DEFAULT_GROUP_PERMISSIONS Env Var - [`32ed90b`](https://github.com/open-webui/open-webui/commit/32ed90bd640c17ed2407dff419e0ab9a3901e583) Fix: Add Oauth Group Permission logic based off of permissions - [`2acff6f`](https://github.com/open-webui/open-webui/commit/2acff6f40bcf069a06a4e0d6a68cfeacf4171ba4) Update oauth.py - [`c710f7a`](https://github.com/open-webui/open-webui/commit/c710f7a76a545a566696d53fedea829da74e73d0) Re-added OAUTH_MAX_SESSIONS_PER_USER ### 📊 Changes **2 files changed** (+33 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+5 -0) 📝 `backend/open_webui/utils/oauth.py` (+28 -1) </details> ### 📄 Description Fix: OAUTH_DEFAULT_GROUP_PERMISSIONS Add oAuth Group Permission logic for new groups based off of permissions environment model by default . If not set, sets to noone as best form of secops. OAUTH_DEFAULT_GROUP_PERMISSIONS = 'members' , 'noone' or 'anyone' ``` group_data_payload = {} oauth_default_permission = ( auth_manager_config.OAUTH_DEFAULT_GROUP_PERMISSIONS ) if oauth_default_permission: if oauth_default_permission.lower() == "members": group_data_payload = {"config": {"share": "members"}} elif oauth_default_permission.lower() == "noone": group_data_payload = {"config": {"share": False}} elif oauth_default_permission.lower() == "anyone": group_data_payload = {"config": {"share": True}} else: log.warning( f"Unknown OAUTH_DEFAULT_GROUP_PERMISSIONS value: {oauth_default_permission}. " "Using empty data payload." ) group_data_payload = {"config": {"share": False}} log.debug( f"Group data payload for OAuth group creation: {group_data_payload}" ) ``` ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. --> By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 13:56:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#41829