- the account is authenticated and active;
- the request is inside the active school;
- the account has the required Django permission, such as
core.view_studentorsrms.change_entry; - the account’s role and relationship allow the specific record;
- the academic period, publication state, ownership, and other model rules allow the action.
Account flags
The user model stores role classifications as independent boolean fields. They are not interchangeable with permissions.
The API exposes a convenient
role string, but it is a simplified classification. Its resolution order is:
is_superuser→adminis_staff→adminis_admin→adminis_dean→deanis_teacher→teacher- otherwise →
student
role: "student"; that value does not by itself prove that a Student profile exists. Client code should use the actual profile and permissions for authorization decisions.
Groups and Django permissions
Kralis creates built-in Django groups and assigns permission bundles to them:
The exact permission names are standard Django codenames in the form:
view, add, change, and delete are separate permissions. A user may be able to view a record without being able to change or delete it.
Role flags do not grant permissions by themselves
GraphQL operations protected withpermission_required call Django has_perm(). In the normal setup, has_perm() succeeds because the account belongs to the corresponding group or has an explicitly assigned permission.
Therefore, an account with is_admin: true but no Admin group can authenticate and still fail every protected operation. When a role appears correct but the API returns:
is_active;- the account’s school and active request school;
- the expected role flag;
- membership in the matching
Student,Teacher,Dean, orAdmingroup; - the specific permission required by the operation.
What each role can access
These are the default product boundaries. A feature can impose a narrower relationship or state rule.Feature-specific teacher scope
Teacher access is relationship-based rather than simply “all or nothing.” The relevant teacher profile assignments are the source of scope.SRMS
- Teachers work against assigned classes and subjects in the teaching UI.
- Teacher mutations for results, entries, annuals, remarks, enrollment, and related SRMS records reject an unassigned class or subject.
- Teacher SRMS mutations are restricted to the current academic year. Deans and admins handle historical-year corrections.
- A teacher may not change a student’s current class. Section changes are separate from class placement and may be allowed when the student is in the teacher’s assigned class.
CBT
- A test is visible to a teacher when it is general, matches an assigned class/subject, or was created by that teacher.
- A student sees published tests for the student’s current class or general tests.
- A student’s test session and response access also checks the student’s current class and the test’s class/subject context.
- Questions and answers are reusable school content for study and reuse when the account has the view permissions. Their class and subject fields are grouping/display context, but when a teacher creates or mutates content with class/subject context, the supplied context must be assigned to that teacher.
LMS
- A teacher can manage their own courses.
- A teacher can manage another course only when its subject is assigned to them and its class is either assigned to them or general.
- Course modules, lessons, and units inherit the course scope.
- Enrollment and progress management additionally requires the learner to be in one of the teacher’s assigned classes.
Broadcast visibility
Broadcast management and broadcast delivery are different operations:broadCastsis the management list and is restricted to administrators and deans withcore.view_broadcast.createBroadCast,updateBroadCast, anddeleteBroadCastrequire the matching add/change/delete permission and the administrator/dean management role.userBroadCastsis the delivery list. It returns current broadcasts targeted to the signed-in user, group, class, subject, course, or school audience. A teacher or student may receive a broadcast without being allowed to manage broadcasts.
Classroom roles are object-specific
Classroom event roles do not replace the account role. The effective event role can be:host— normally the event creator or an explicit host grant;moderator— a school administrator/dean or explicit moderator grant;presenter— an explicit presenter grant;participant— a matching audience or grant;observer— an explicit observer grant.
Permission troubleshooting
Use the failure message to identify the layer:
For custom clients, handle forbidden results as expected authorization outcomes and refresh
viewer/authSchool after an account, role, group, or school-context change.
See School Scoping and Authorization and Authentication for the request lifecycle.
