public function browserPostAction($path, $action, $postVars)
    {
        if ('share' !== $action) {
            return;
        }

        if (empty($postVars['href'])) {
            throw new BadRequest('The "href" POST parameter is required');
        }
        if (empty($postVars['access'])) {
            throw new BadRequest('The "access" POST parameter is required');
        }

        $accessMap = [
            'readwrite' => self::ACCESS_READWRITE,
            'read' => self::ACCESS_READ,
            'no-access' => self::ACCESS_NOACCESS,
        ];

        if (!isset($accessMap[$postVars['access']])) {
            throw new BadRequest('The "access" POST must be readwrite, read or no-access');
        }
        $sharee = new Sharee([
            'href' => $postVars['href'],
            'access' => $accessMap[$postVars['access']],
        ]);

        $this->shareResource(
            $path,
            [$sharee]
        );

        return false;
    }
public function browserPostAction($path, $action, $postVars)
    {
        if ('share' !== $action) {
            return;
        }

        if (empty($postVars['href'])) {
            throw new BadRequest('The "href" POST parameter is required');
        }
        if (empty($postVars['access'])) {
            throw new BadRequest('The "access" POST parameter is required');
        }

        $accessMap = [
            'readwrite' => self::ACCESS_READWRITE,
            'read' => self::ACCESS_READ,
            'no-access' => self::ACCESS_NOACCESS,
        ];

        if (!isset($accessMap[$postVars['access']])) {
            throw new BadRequest('The "access" POST must be readwrite, read or no-access');
        }
        $sharee = new Sharee([
            'href' => $postVars['href'],
            'access' => $accessMap[$postVars['access']],
        ]);

        $this->shareResource(
            $path,
            [$sharee]
        );

        return false;
    }
public function browserPostAction ( $ path , $ action , $ postVars ) { if ( 'share' !== $ action ) { return ; } if ( empty ( $ postVars [ 'href' ] ) ) { throw new BadRequest ( 'The "href" POST parameter is required' ) ; } if ( empty ( $ postVars [ 'access' ] ) ) { throw new BadRequest ( 'The "access" POST parameter is required' ) ; } $ accessMap = [ 'readwrite' => self :: ACCESS_READWRITE , 'read' => self :: ACCESS_READ , 'no-access' => self :: ACCESS_NOACCESS , ] ; if ( ! isset ( $ accessMap [ $ postVars [ 'access' ] ] ) ) { throw new BadRequest ( 'The "access" POST must be readwrite, read or no-access' ) ; } $ sharee = new Sharee ( [ 'href' => $ postVars [ 'href' ] , 'access' => $ accessMap [ $ postVars [ 'access' ] ] , ] ) ; $ this -> shareResource ( $ path , [ $ sharee ] ) ; return false ; }
This method is triggered for POST actions generated by the browser
plugin.

@param string $path
@param string $action
@param array  $postVars
This method is triggered for POST actions generated by the browser plugin .