Skip to content

Latest commit

 

History

History
299 lines (200 loc) · 9.04 KB

GroupsApi.md

File metadata and controls

299 lines (200 loc) · 9.04 KB

Ory\Hydra\GroupsApi

All URIs are relative to http://localhost

Method HTTP request Description
addMembersToGroup POST /warden/groups/{id}/members Add members to a group
createGroup POST /warden/groups Create a group
deleteGroup DELETE /warden/groups/{id} Delete a group by id
findGroupsByMember GET /warden/groups Find group IDs by member
getGroup GET /warden/groups/{id} Get a group by id
removeMembersFromGroup DELETE /warden/groups/{id}/members Remove members from a group

addMembersToGroup

addMembersToGroup($id, $body)

Add members to a group

The subject making the request needs to be assigned to a policy containing: { \"resources\": [\"rn:hydra:warden:groups:<id>\"], \"actions\": [\"members.add\"], \"effect\": \"allow\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
Ory\Hydra\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Ory\Hydra\Api\GroupsApi(new \Http\Adapter\Guzzle6\Client());
$id = 789; // int | The id of the group to modify.
$body = new \Ory\Hydra\Model\MembersRequest(); // \Ory\Hydra\Model\MembersRequest | 

try {
    $api_instance->addMembersToGroup($id, $body);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->addMembersToGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int The id of the group to modify.
body \Ory\Hydra\Model\MembersRequest [optional]

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createGroup

\Ory\Hydra\Model\Group createGroup()

Create a group

The subject making the request needs to be assigned to a policy containing: { \"resources\": [\"rn:hydra:warden:groups\"], \"actions\": [\"create\"], \"effect\": \"allow\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
Ory\Hydra\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Ory\Hydra\Api\GroupsApi(new \Http\Adapter\Guzzle6\Client());

try {
    $result = $api_instance->createGroup();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->createGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\Ory\Hydra\Model\Group

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteGroup

deleteGroup($id)

Delete a group by id

The subject making the request needs to be assigned to a policy containing: { \"resources\": [\"rn:hydra:warden:groups:<id>\"], \"actions\": [\"delete\"], \"effect\": \"allow\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
Ory\Hydra\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Ory\Hydra\Api\GroupsApi(new \Http\Adapter\Guzzle6\Client());
$id = 789; // int | The id of the group to look up.

try {
    $api_instance->deleteGroup($id);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->deleteGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int The id of the group to look up.

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

findGroupsByMember

string[] findGroupsByMember($member)

Find group IDs by member

The subject making the request needs to be assigned to a policy containing: { \"resources\": [\"rn:hydra:warden:groups:<member>\"], \"actions\": [\"get\"], \"effect\": \"allow\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
Ory\Hydra\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Ory\Hydra\Api\GroupsApi(new \Http\Adapter\Guzzle6\Client());
$member = 789; // int | The id of the member to look up.

try {
    $result = $api_instance->findGroupsByMember($member);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->findGroupsByMember: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
member int The id of the member to look up. [optional]

Return type

string[]

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroup

\Ory\Hydra\Model\Group getGroup($id)

Get a group by id

The subject making the request needs to be assigned to a policy containing: { \"resources\": [\"rn:hydra:warden:groups:<id>\"], \"actions\": [\"create\"], \"effect\": \"allow\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
Ory\Hydra\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Ory\Hydra\Api\GroupsApi(new \Http\Adapter\Guzzle6\Client());
$id = 789; // int | The id of the group to look up.

try {
    $result = $api_instance->getGroup($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->getGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int The id of the group to look up.

Return type

\Ory\Hydra\Model\Group

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

removeMembersFromGroup

removeMembersFromGroup($id, $body)

Remove members from a group

The subject making the request needs to be assigned to a policy containing: { \"resources\": [\"rn:hydra:warden:groups:<id>\"], \"actions\": [\"members.remove\"], \"effect\": \"allow\" }

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
Ory\Hydra\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Ory\Hydra\Api\GroupsApi(new \Http\Adapter\Guzzle6\Client());
$id = 789; // int | The id of the group to modify.
$body = new \Ory\Hydra\Model\MembersRequest(); // \Ory\Hydra\Model\MembersRequest | 

try {
    $api_instance->removeMembersFromGroup($id, $body);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->removeMembersFromGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int The id of the group to modify.
body \Ory\Hydra\Model\MembersRequest [optional]

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]