PHP Bitbucket API

Simple Bitbucket API wrapper for PHP

Users privileges

Use this resource to manage privilege settings for a team account. Team accounts can grant groups account privileges as well as repository access.

Prepare:

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

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

Get a list of privilege groups on a team account:

$users->privileges()->team($account_name);

Gets the privilege associated with the specified group:

$users->privileges()->group($account_name, 'john', 'testers');

Updates an existing group's privileges for a team account:

$users->privileges()->update($account_name, 'john', 'testers', 'collaborator');

Add a privilege to a group:

$users->privileges()->create($account_name, 'john', 'testers', 'admin');

Deletes a privilege.

$users->privileges()->delete($account_name, 'john', 'testers');