Skip to main content
Kralis authorization is the combination of several checks. A successful login only proves that the account is authenticated; it does not grant every operation in the school. An operation is allowed only when all applicable checks pass:
  1. the account is authenticated and active;
  2. the request is inside the active school;
  3. the account has the required Django permission, such as core.view_student or srms.change_entry;
  4. the account’s role and relationship allow the specific record;
  5. 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:
  1. is_superuser → admin
  2. is_staff → admin
  3. is_admin → admin
  4. is_dean → dean
  5. is_teacher → teacher
  6. otherwise → student
Keep role flags mutually exclusive for normal school accounts. A general account with none of the school-role flags can still receive the fallback 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:
Examples include:
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 with permission_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:
check, in this order:
  1. is_active;
  2. the account’s school and active request school;
  3. the expected role flag;
  4. membership in the matching Student, Teacher, Dean, or Admin group;
  5. the specific permission required by the operation.
The browser may hide actions based on role, but the API remains the authority. Adding a button or navigating directly to a page does not bypass a missing permission.

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:
  • broadCasts is the management list and is restricted to administrators and deans with core.view_broadcast.
  • createBroadCast, updateBroadCast, and deleteBroadCast require the matching add/change/delete permission and the administrator/dean management role.
  • userBroadCasts is 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.
When more than one source applies, the strongest event role wins. Draft events are visible only to users who can manage them; published/live event visibility is still based on audience, grants, ownership, and school context.

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.