BookStack\Repos\UserRepo::attachDefaultRole PHP Method

attachDefaultRole() public method

Give a user the default role. Used when creating a new user.
public attachDefaultRole ( $user )
$user
    public function attachDefaultRole($user)
    {
        $roleId = setting('registration-role');
        if ($roleId === false) {
            $roleId = $this->role->first()->id;
        }
        $user->attachRoleId($roleId);
    }