public function can($permission, $allowAny = false)
    {
        if ($allowAny) {
            return $this->hasAnyAccess(
                is_array($permission) ? $permission : [ $permission ]
            );
        }

        return $this->hasAccess(
            is_array($permission) ? $permission : [ $permission ]
        );
    }
public function can($permission, $allowAny = false)
    {
        if ($allowAny) {
            return $this->hasAnyAccess(
                is_array($permission) ? $permission : [ $permission ]
            );
        }

        return $this->hasAccess(
            is_array($permission) ? $permission : [ $permission ]
        );
    }
public function can ( $ permission , $ allowAny = false ) { if ( $ allowAny ) { return $ this -> hasAnyAccess ( is_array ( $ permission ) ? $ permission : [ $ permission ] ) ; } return $ this -> hasAccess ( is_array ( $ permission ) ? $ permission : [ $ permission ] ) ; }
Returns whether the user has the given permission.

@param string|string[] $permission
@param bool            $allowAny if true, allows if any is permitted
@return bool
Returns whether the user has the given permission .