- Published
- February 19, 2026
- Last Updated
- February 19, 2026
- Author
- François de Ryckel
Institutional Policy: Policy Identity and Scope Anchor
Define policy identity, organization/school scope, and target audience so active policy versions can be resolved and acknowledged correctly.
Before You Start (Prerequisites)
- Create the target
Organizationfirst (policy scope anchor). - Decide
policy_key, category, and applies-to audience model before insertion. - Create policy identity records before creating any
Policy Versionrows.
What policy_key Is
policy_key is the stable machine identifier for a policy identity.
- It is not display text;
policy_titleis the human-facing label. - It is used by server logic to resolve policy requirements by organization scope (nearest policy per key).
- It is immutable after insert.
- It must be unique within the same
organization.
Example used in current code: media_consent (image publish consent flow).
Where to Find Existing policy_key Values
There is no separate "policy key catalog" DocType in the current model. Existing keys are found in policy records:
- Desk list view:
Institutional Policy->policy_keycolumn. - Desk form:
Institutional Policy->policy_keyfield on each record. - Admissions readiness/policy payloads:
Student Applicantreadiness (has_required_policies) returns missing/required labels from policy key/name chain.- Admissions portal policy list (
get_applicant_policies) labels policies bypolicy_keyfirst, then title/name fallback.
- Code-level constants for specific product behavior (example):
ifitwala_ed/governance/policy_utils.py->MEDIA_CONSENT_POLICY_KEY.
Related Policy Doctypes
- Policy Version - legal text snapshots under an institutional policy
- Policy Acknowledgement - append-only acknowledgement evidence rows
Institutional Policy defines what a policy is, where it applies, and who it applies to. It is the semantic root for all policy versions and acknowledgements.
What It Enforces
- Policy identity is stable through
policy_key+organization. policy_keyandorganizationare immutable after insert.schoolis optional; blank means organization-wide scope.schoolcan be set one time if initially blank, then becomes immutable.policy_categorymust be one of the locked categories in governance utilities.schoolmust be inside policy organization scope (organization descendants allowed).- Deletion is blocked; policy should be deactivated instead (
is_active = 0).
School Scope Resolution
schoolblank (NULL/empty) means the policy is org-wide for the selectedorganizationscope.- When
schoolis set to a parent school, the policy applies to that school and all descendant schools. - School matching uses applicant school lineage (
self -> parent -> ...) plus org-wide blank fallback. - Final policy selection remains nearest-only by
policy_keyon the Organization ancestor chain.
Where It Is Used Across the ERP
- Policy Version: parent link (
institutional_policy) requires active policy. - Policy Acknowledgement: scope checks resolve policy organization from parent chain.
- Student Applicant:
- readiness policy requirements (
has_required_policies) - admissions portal policy list (
get_applicant_policies)
- readiness policy requirements (
- Media consent publish gate:
policy_key = media_consent- read by
has_applicant_policy_acknowledgementduring applicant promotion image publish logic.
- Nearest-only organization override:
- policy candidates are filtered using
select_nearest_policy_rows_by_keyagainst Organization ancestor chain.
- policy candidates are filtered using
Lifecycle and Linked Documents
- Create policy identity (
policy_key) and audience/scope under the correct organization. - Create one or more
Policy Versionrows as legal text snapshots under this policy. - Activate/deactivate policy identity based on institutional policy lifecycle.
- Collect acknowledgements through
Policy Acknowledgementusing active versions only.
Policy scope is organization-sensitive. Wrong scope setup causes downstream acknowledgement and readiness mismatches.
Treat this record as long-lived identity. Version the legal text in Policy Version instead of replacing policy roots.
Technical Notes (IT)
Schema and Controller Snapshot
DocType schema file:
ifitwala_ed/governance/doctype/institutional_policy/institutional_policy.jsonController file:
ifitwala_ed/governance/doctype/institutional_policy/institutional_policy.pyRequired fields (
reqd=1):policy_key(Data)policy_title(Data)policy_category(Select)applies_to(MultiSelect)organization(Link->Organization)is_active(Check)
Lifecycle hooks in controller:
before_insert,before_save,before_deleteOperational/public methods: none beyond standard document behavior.
DocType:
Institutional Policy(ifitwala_ed/governance/doctype/institutional_policy/)Autoname:
hashFields:
policy_key(Data, required)policy_title(Data, required)policy_category(Select, required)applies_to(MultiSelect, required):Applicant,Student,Guardian,Stafforganization(Link -> Organization, required)school(Link -> School, optional)description(Small Text)is_active(Check, required, default1)
Controller guards:
before_insert: admin permission, category validation, unique policy key by organization, school scope validationbefore_save: admin permission, school scope validation, immutability enforcement (schoolone-time set if previously blank)before_delete: hard block
Scope helper:
is_school_within_policy_organization_scopevalidates school organization ancestry under the policy organization.
Permission Matrix
| Role | Read | Write | Create | Delete | Notes |
|---|---|---|---|---|---|
System Manager |
Yes | Yes | Yes | Yes | Doctype permission allows delete; controller blocks delete |
Organization Admin |
Yes | Yes | Yes | Yes | Doctype permission allows delete; controller blocks delete |
Runtime controller rule:
- Policy management is restricted to policy admins (
System ManagerorOrganization Admin), regardless of Desk form visibility.
Related Docs
- Policy Version - legal text versions under this policy identity
- Policy Acknowledgement - evidence rows tied to active versions
- Student Applicant - admissions readiness and portal policy flows