src/main/php/auth/session/CachingAuthorizationProvider.php
public function roles(User $user)
    {
        if ($this->session->hasValue(Roles::SESSION_KEY)) {
            return $this->session->value(Roles::SESSION_KEY);
        }

        $roles = $this->authorizationProvider->roles($user);
        $this->session->putValue(Roles::SESSION_KEY, $roles);
        return $roles;
    }
public function roles(User $user)
    {
        if ($this->session->hasValue(Roles::SESSION_KEY)) {
            return $this->session->value(Roles::SESSION_KEY);
        }

        $roles = $this->authorizationProvider->roles($user);
        $this->session->putValue(Roles::SESSION_KEY, $roles);
        return $roles;
    }
public function roles ( User $ user ) { if ( $ this -> session -> hasValue ( Roles :: SESSION_KEY ) ) { return $ this -> session -> value ( Roles :: SESSION_KEY ) ; } $ roles = $ this -> authorizationProvider -> roles ( $ user ) ; $ this -> session -> putValue ( Roles :: SESSION_KEY , $ roles ) ; return $ roles ; }
returns the roles available for this request and user

@param   \stubbles\webapp\auth\User  $user
@return  \stubbles\webapp\auth\Roles|null
returns the roles available for this request and user