-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix(UX): bulk delete error messages (cherry picked from commit 926c888) * feat: Limit OAuth Client by roles (cherry picked from commit ae4eb87) # Conflicts: # frappe/integrations/doctype/oauth_client/oauth_client.json # frappe/patches.txt * chore: conflicts --------- Co-authored-by: Ankush Menat <ankush@frappe.io>
- Loading branch information
1 parent
376a9fb
commit c8387f8
Showing
13 changed files
with
105 additions
and
102 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
11 changes: 11 additions & 0 deletions
11
frappe/integrations/doctype/oauth_client/patches/set_default_allowed_role_in_oauth_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import frappe | ||
|
||
|
||
def execute(): | ||
"""Set default allowed role in OAuth Client""" | ||
for client in frappe.get_all("OAuth Client", pluck="name"): | ||
doc = frappe.get_doc("OAuth Client", client) | ||
if doc.allowed_roles: | ||
continue | ||
row = doc.append("allowed_roles", {"role": "All"}) # Current default | ||
row.db_insert() |
Empty file.
31 changes: 31 additions & 0 deletions
31
frappe/integrations/doctype/oauth_client_role/oauth_client_role.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"actions": [], | ||
"creation": "2024-04-29 12:08:19.459404", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"role" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "role", | ||
"fieldtype": "Link", | ||
"in_list_view": 1, | ||
"label": "Role", | ||
"options": "Role" | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"istable": 1, | ||
"links": [], | ||
"modified": "2024-04-29 12:16:48.018031", | ||
"modified_by": "Administrator", | ||
"module": "Integrations", | ||
"name": "OAuth Client Role", | ||
"owner": "Administrator", | ||
"permissions": [], | ||
"sort_field": "creation", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
23 changes: 23 additions & 0 deletions
23
frappe/integrations/doctype/oauth_client_role/oauth_client_role.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) 2024, Frappe Technologies and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class OAuthClientRole(Document): | ||
# begin: auto-generated types | ||
# This code is auto-generated. Do not modify anything in this block. | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from frappe.types import DF | ||
|
||
parent: DF.Data | ||
parentfield: DF.Data | ||
parenttype: DF.Data | ||
role: DF.Link | None | ||
# end: auto-generated types | ||
|
||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters