Skip to content

Publish module grants in the permission manifest - #1

Merged
vikrantwiz02 merged 1 commit into
mainfrom
iam/publish-module-grants
Aug 9, 2026
Merged

Publish module grants in the permission manifest#1
vikrantwiz02 merged 1 commit into
mainfrom
iam/publish-module-grants

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

Companion to Fusion_System_Administrator#90, which merged yesterday. That change
made seed_iam_permissions read module access from this manifest, keyed on
module_grants. Nothing here writes that key, so on main today the IAM seeds
no module grants at all.

The symptom is not obvious from either side. A session comes back with its
permissions correct and modules: [], which renders as an empty sidebar and a
403 on every screen — so it reads as a permissions problem when it is the other
gate. Access is two separate checks, may this role enter the module and may
it perform this action
, and only the second was being published.

What changed

module_grants is derived from ROLE_GRANTS rather than listed by hand.
Any designation granted a permission inside a module must be able to open that
module, so maintaining the two separately only creates a way for them to
disagree.

scope_permissions covers permissions enforced by narrowing a queryset
instead of refusing a request. Holding one widens what you see; not holding it
shows you less. There is no endpoint to find them in, so the manifest has to
say so, and the unenforced-permission check now reads that list rather than
reporting them as dead code.

Verification

Full clean install — fresh clones, empty databases, restored dump — before and
after, same student account:

before:  6 permissions, modules []
after:   6 permissions, modules ['placement_cell']

make check is green: 407 tests, schema matches, import contracts hold.

Note

Worth merging promptly — main is in the broken state until it lands, since the
IAM half is already in.

The IAM seeds module access from this file and looks for a module_grants key
per module. Nothing writes one, so it seeds none, and a session comes back with
its permissions correct and no modules at all — which renders as an empty
sidebar and a 403 on every screen. Access is two separate gates, may this role
enter the module and may it perform this action, and only the second was being
published.

module_grants is derived from ROLE_GRANTS rather than listed by hand: any
designation granted a permission in a module must be able to open that module,
so writing the two out separately only creates a way for them to disagree.

Also adds scope_permissions, for permissions enforced by narrowing a queryset
rather than by refusing a request. There is no endpoint to find them in, so the
manifest has to say so explicitly, and the unenforced-permission check now
reads that list instead of reporting them as dead.

Verified against a clean install: before, a student session resolves 6
permissions and modules []; after, the same session resolves 6 permissions and
modules ['placement_cell'].
@vikrantwiz02
vikrantwiz02 merged commit 20878b3 into main Aug 9, 2026
4 of 6 checks passed
@vikrantwiz02
vikrantwiz02 deleted the iam/publish-module-grants branch August 9, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant