LocalGroupUserRepository.php 1.86 KB
Newer Older
1
2
3
4
5
6
7
8
<?php


namespace Source\Gateways\GroupUser;

use Source\Gateways\Users\LocalUsersRepository;
use Source\Gateways\Groups\LocalGroupsRepository;

Jacob Priddy's avatar
Jacob Priddy committed
9
10
class LocalGroupUserRepository extends InMemoryGroupUserRepository
{
11
12
13
14
15
16
17
18
19
    /**
     * @param \Source\Gateways\Users\LocalUsersRepository   $users
     * @param \Source\Gateways\Groups\LocalGroupsRepository $groups
     * @throws \Exception
     */
    public function __construct(LocalUsersRepository $users, LocalGroupsRepository $groups)
    {
        parent::__construct($users, $groups);

20
        $this->addUserToGroup(LocalUsersRepository::getAdminUser()->getId(), LocalGroupsRepository::getAdminGroup()->getId());
21

22
23
24
25
26
        $this->addUserToGroup(LocalUsersRepository::getSemiPrivilegedUser()->getId(), LocalGroupsRepository::getManageUsersGroup()->getId());
        $this->addUserToGroup(LocalUsersRepository::getSemiPrivilegedUser()->getId(), LocalGroupsRepository::getManageDoorsGroup()->getId());
        $this->addUserToGroup(LocalUsersRepository::getSemiPrivilegedUser()->getId(), LocalGroupsRepository::getManageTokenGroup()->getId());
        $this->addUserToGroup(LocalUsersRepository::getSemiPrivilegedUser()->getId(), LocalGroupsRepository::getTokenCreateGroup()->getId());
        $this->addUserToGroup(LocalUsersRepository::getSemiPrivilegedUser()->getId(), LocalGroupsRepository::getCodeQueryGroup()->getId());
Jacob Priddy's avatar
Jacob Priddy committed
27
        $this->addUserToGroup(LocalUsersRepository::getSemiPrivilegedUser()->getId(), LocalGroupsRepository::getManageGroupsGroup()->getId());
28
29

        $this->addUserToGroup(
30
31
            LocalUsersRepository::getComputerScienceStudent()->getId(),
            LocalGroupsRepository::getComputerScienceMajorGroup()->getId()
32
33
        );
        $this->addUserToGroup(
34
35
            LocalUsersRepository::getEngineeringLabAccessStudent()->getId(),
            LocalGroupsRepository::getEngineeringLabAccessGroup()->getId()
36
37
38
        );
    }
}