示例#1
0
    def _create_worker_role() -> None:
        worker_role = RoleModel.get_or_none(name='worker')

        if worker_role is None:
            params = {
                'name': 'worker',
                'description': 'Worker',
                'label': 'Worker',
                'deleted_at': None,
            }
            Factory('Role').save(params)
示例#2
0
    def _create_admin_role() -> None:
        admin_role = RoleModel.get_or_none(name='admin')

        if admin_role is None:
            params = {
                'name': 'admin',
                'description': 'Administrator',
                'label': 'Admin',
                'deleted_at': None,
            }
            Factory('Role').save(params)
示例#3
0
    def _create_team_leader() -> None:
        team_leader_role = RoleModel.get_or_none(name='team_leader')

        if team_leader_role is None:
            params = {
                'name': 'team_leader',
                'description': 'Team leader',
                'label': 'Team leader',
                'deleted_at': None,
            }
            Factory('Role').save(params)