Skip to content

api: Additional information pertaining to roles #19

@MathiasDevelopes

Description

@MathiasDevelopes

In InSchool, you assume roles that grant you privileges, e.g a Learner, Teacher, Principal...

We will implement a type based on the following roles, and also consider implementing endpoints hidden behind certain privileges (if feasable and possible).

function getUserRoles() {
        return {
            teacher: "ROLE_TEACHER",
            principal: "ROLE_PRINCIPAL",
            learner: "ROLE_LEARNER",
            contact: "ROLE_CONTACT",
            admin: "ROLE_ADMIN",
            schoolOwner: "ROLE_SCHOOL_OWNER",
            allRoles: ["ROLE_TEACHER", "ROLE_PRINCIPAL", "ROLE_LEARNER", "ROLE_CONTACT", "ROLE_ADMIN", "ROLE_SCHOOL_OWNER"],
        };
    }

Associated relations and importance to these files

src/api/types/user.ts
src/api/endpoints/user.ts

Metadata

Metadata

Labels

apiEverything pertaining to the API interface.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions