protected function hasRole( array $roles )
	{
		if( $this->has( 'security.authorization_checker' ) && $this->get( 'security.token_storage' )->getToken() )
		{
			$checker = $this->get( 'security.authorization_checker' );

			foreach( $roles as $role )
			{
				if( $checker->isGranted( $role ) ) {
					return true;
				}
			}
		}

		return false;
	}
protected function hasRole( array $roles )
	{
		if( $this->has( 'security.authorization_checker' ) && $this->get( 'security.token_storage' )->getToken() )
		{
			$checker = $this->get( 'security.authorization_checker' );

			foreach( $roles as $role )
			{
				if( $checker->isGranted( $role ) ) {
					return true;
				}
			}
		}

		return false;
	}
protected function hasRole ( array $ roles ) { if ( $ this -> has ( 'security.authorization_checker' ) && $ this -> get ( 'security.token_storage' ) -> getToken ( ) ) { $ checker = $ this -> get ( 'security.authorization_checker' ) ; foreach ( $ roles as $ role ) { if ( $ checker -> isGranted ( $ role ) ) { return true ; } } } return false ; }
Checks if the used is authenticated and has the admin role

@param array $roles List of role names where at least one must match
@return boolean True if authenticated and is admin, false if not
Checks if the used is authenticated and has the admin role