PHP Bitbucket API

Simple Bitbucket API wrapper for PHP

Group Privileges

Manages a group's repository permissions.

Prepare

// @see: https://bitbucket.org/account/user/<username or team>/api
$oauth_params = array(
    'client_id'         => 'aaa',
    'client_secret'     => 'bbb'
);

$privileges = new \Bitbucket\API\GroupPrivileges();
$privileges->getClient()->addListener(
    new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);

Get a list of privileged groups

$groups = $privileges->groups($account_name);

Get a list of privileged groups for a repository

$groups = $privileges->repository($account_name, $repo_slug);

Gets the privileges of a group on a repository.

$group = $privileges->group($account_name, $repo_slug, $group_owner, $group_slug);

Get a list of the repositories on which a particular privilege group appears.

$repos = $privileges->repositories($account_name, $group_owner, $group_slug);

Grant group privileges on a repository.

$privileges->grant($account_name, $repo_slug, $group_owner, $group_slug, 'read');

Delete group privileges from a repository

$privileges->delete($account_name, $repo_slug, $group_owner, $group_slug);