Skip to content

Latest commit

 

History

History
91 lines (54 loc) · 5.25 KB

File metadata and controls

91 lines (54 loc) · 5.25 KB

Seed roles

Roles and assigning roles

The seed script roles.py creates roles. These roles are assigned to users in users_with_roles.py.

The role permissions are configured to resemble roles as they should be imlemented in production, but this is hard to get on the first try so the configuration will probably have to change by trial and error.

If you want to change role configuration of the roles generated by the seed scripts it is easiest to do by using the Django admin panel. Checkout Roles, User gang roles, User gang section roles and User org roles.

Roles in the seed script

An important take-away from the roles generated by the seedscript is that they represent an artificail system. The real implementation of roles will probably be better suited and tailormade for each usecase.

Role name Description Type
gangleader As in "gjeng sjef" Basic gang role
vice_gangleader As in "nestleder", ex: mg-nestleder Basic gang role
sectionleader As in "seksjonssjef", ex: websjef Basic gang role
gang_member As in a member of some gang. All interns would have this role. Basic gang role
redaksjonen A special role for Redaksjonen. Should have globale permissions. Special role
styret A special role for "Samfundet styret". Should have permissions on the Samfundet organization object. Special role
raadet A special role for "Samfundet rådet". Should have permissions on the Samfundet organization object. Special role
eventmanager A role for users which will be creating and editing events, like KLST and LØK. Special role
venuemanager A role for user which will be managing venue menus, tables and reservations. Special role
org_recruitmentmanager A role for the top most responsible for a recruitment. At Samfundet this would be "GU-nestleder". Recruitment role
gang_recruitmentmanager A role for a user responsible for a gangs recruitment actions. In MG this is MG-nestleder. Recruitment role
section_recruitmentmanager A role for a user which is responsible for a sections recruitment actions. Recruitment role
section_interviewer A role for users which will be part of recruitment interviews. Recruitment role

Basic gang roles

The roles are created for all sections and gangs in all organizations.

Special roles

These roles are only created for the Samfundet organization.

Recruitment roles

These roles are created for all organizations, and the gangs and sections in these.

The recruitment roles in the seed script are configured to work for Samfundet. ISFiT and UKA might need a different configuration because they do recruitment diffrently from Samfundet. For example sections at UKA/ISFiT has very little to do with interview management. This is a task performed by a org_recruitment_manager role.

Users in the seed script

The users_with_roles.py seed script creates users with roles following specific naming patterns that reflect the role and hierarchy level. Understanding these naming conventions helps you navigate the system and identify which users have specific permissions.

Usernames created by the users with roles seed script follows this pattern: {organization}_{gang}_{section}_{role}_{sequential number}

Where:

  • {organization} - Abbreviated organization name (e.g., "samfundet")
  • {gang} - Gang abbreviation or name (e.g., "mg" for Markedsføringsgjengen)
  • {section} - Section name (e.g., "web")
  • {role} - Role identifier (e.g., "leader", "recruitmentmanager", "interviewer")

Organization level

Contains only organization and role components

{org}_recruitmentmanager_1

Gang level

Contains organization, gang, and role components

{org}_{gang}_leader_1

Section level

Contains organization, gang, section, and role components

{org}_{gang}_{section}_sectionleader_1

There is generated 10 interviewer users for each section.

User creation process

The seed script:

  1. Removes all existing non-superusers
  2. Creates users for each organization according to their hierarchy
  3. Assigns appropriate roles with permissions
  4. Sets a default password ("test123") for all users