Skip to content

Commit ddcc6d5

Browse files
committed
refactor: simplify action matching logic in authorization model
1 parent b0a0620 commit ddcc6d5

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

openedx_authz/management/commands/model.conf

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,4 @@ g2 = _, _
1212
e = some(where (p.eft == allow)) && !some(where (p.eft == deny))
1313

1414
[matchers]
15-
# Authorization matching logic
16-
#
17-
# SCOPE MATCHING:
18-
# - g(r.sub, p.sub, r.scope): check if subject has role in requested scope
19-
# - g(r.sub, p.sub, "*"): check if subject has global role
20-
#
21-
# OBJECT MATCHING:
22-
# - keyMatch(r.obj, p.obj): matches object IDs using exact match or regex patterns
23-
#
24-
# ACTION MATCHING:
25-
# - r.act == p.act: exact action match
26-
# - g2(p.act, r.act): policy action implies requested action via grouping
27-
#
28-
# All conditions must be true for a policy to match
29-
m = (g(r.sub, p.sub, r.scope) || g(r.sub, p.sub, "*")) && keyMatch(r.obj, p.obj) && (r.act == p.act || g2(p.act, r.act))
15+
m = (g(r.sub, p.sub, r.scope) || g(r.sub, p.sub, "*")) && keyMatch(r.obj, p.obj) && g2(p.act, r.act)

0 commit comments

Comments
 (0)