Skip to content

Create isAdminUser() function #75

@aryanprince

Description

@aryanprince

We would need a role column in our User table.

role can be an Enum with the following options: "STUDENT", "TEACHER", "ADMIN"

By default, let's set the 3 of us to "ADMIN"/"SUPERADMIN" and then every other user who signs up gets "GUEST"/"STUDENT" role by default.

Now when I call the function isAdminUser(), the function checks the database for the currently logged in user's role, and returns true / false if he's "ADMIN".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions