Commit c68f7069 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix setLastRole 2

parent 1de55793
Loading
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -92,6 +92,29 @@ class Authentification implements UserInterface, ProviderInterface
        $this->settings = [];
    }


    protected $lastRole;

    /**
     * @return AbstractRole|null
     */
    public function getLastRole()
    {
        return $this->lastRole;
    }

    /**
     * @param AbstractRole|null $lastRole
     * @return self
     */
    public function setLastRole($lastRole = null)
    {
        $this->lastRole = $lastRole;

        return $this;
    }


    public function hasRole( $roleId ){
        foreach ($this->getRoles() as $role ){
            if( $roleId == $role ){