Skip to content

Commit 4c1577a

Browse files
docs: update scope docstring
1 parent 5e8453d commit 4c1577a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

openedx_authz/api/data.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ def __call__(cls, *args, **kwargs):
184184
# When working with global scopes, we can't determine subclass with an external_key since
185185
# a global scope it's not attached to a specific resource type. So we only use * as an
186186
# an external_key to mean generic scope which maps to base ScopeData class.
187+
# The only remaining issue is that internally the namespace key used in policies will be
188+
# The generic scope namespace (sc^*), so we need to handle that case here.
187189
if kwargs.get("external_key") == GENERIC_SCOPE_WILDCARD:
188190
return super().__call__(*args, **kwargs)
189191

@@ -309,6 +311,11 @@ class ScopeData(AuthZData, metaclass=ScopeMeta):
309311
'sc^generic_scope'
310312
"""
311313

314+
# The 'sc' namespace is used for generic scopes that aren't tied to a specific resource type.
315+
# This base class supports:
316+
# 1. Global scopes (external_key='*') that apply across all resource types
317+
# 2. Custom generic scopes that don't map to specific domain objects
318+
# Subclasses like ContentLibraryData ('lib') represent concrete resource types.
312319
NAMESPACE: ClassVar[str] = "sc"
313320

314321
@classmethod

0 commit comments

Comments
 (0)