|
| 1 | +## Organization / Webhooks API |
| 2 | +[Back to the navigation](../README.md) |
| 3 | + |
| 4 | +Listing, showing, assigning, and removing orgniazationroles. |
| 5 | +Wraps [GitHub Organization Roles API](https://docs.github.com/en/rest/orgs/organization-roles). |
| 6 | + |
| 7 | +Additional APIs: |
| 8 | +* [Organization](../doc/organization) |
| 9 | + |
| 10 | +### List all organizaton roles in an organization |
| 11 | + |
| 12 | +> Requires [authentication](../security.md). |
| 13 | +
|
| 14 | +```php |
| 15 | +$roles = $client->organization()->organizationRoles()->all('acme'); |
| 16 | +``` |
| 17 | + |
| 18 | +Returns a counter and a list of organization roles in the organization. |
| 19 | + |
| 20 | +### Get an organization role in an organization |
| 21 | + |
| 22 | +> Requires [authentication](../security.md). |
| 23 | +
|
| 24 | +```php |
| 25 | +$role = $client->organization()->organizationRoles()->show('acme', 123); |
| 26 | +``` |
| 27 | + |
| 28 | +Returns a single organization role in the organization. |
| 29 | + |
| 30 | +### List all teams with role assigned in an organization |
| 31 | + |
| 32 | +> Requires [authentication](../security.md). |
| 33 | +
|
| 34 | +```php |
| 35 | +$users = $client->organization()->organizationRoles()->listTeamsWithRole('acme', 1); |
| 36 | +``` |
| 37 | + |
| 38 | +Returns a list of teams with the role assigned to them. |
| 39 | + |
| 40 | +### Assign a single role to a team in an organization |
| 41 | + |
| 42 | +> Requires [authentication](../security.md). |
| 43 | +
|
| 44 | +```php |
| 45 | +$client->organization()->organizationRoles()->assignRoleToTeam('acme', 1, 'admin-user'); |
| 46 | +``` |
| 47 | + |
| 48 | +No content is returned. |
| 49 | + |
| 50 | +### Remove a single role from a team in an organization |
| 51 | + |
| 52 | +> Requires [authentication](../security.md). |
| 53 | +
|
| 54 | +```php |
| 55 | +$client->organization()->organizationRoles()->removeRoleFromTeam('acme', 1, 'admin-team'); |
| 56 | +``` |
| 57 | + |
| 58 | +No content is returned. |
| 59 | + |
| 60 | +### Remove all roles from a team in an organization |
| 61 | + |
| 62 | +> Requires [authentication](../security.md). |
| 63 | +
|
| 64 | +```php |
| 65 | +$client->organization()->organizationRoles()->removeAllRolesFromTeam('acme', 'admin-team'); |
| 66 | +``` |
| 67 | + |
| 68 | +No content is returned. |
| 69 | + |
| 70 | +### List all users with role assigned in an organization |
| 71 | + |
| 72 | +> Requires [authentication](../security.md). |
| 73 | +
|
| 74 | +```php |
| 75 | +$users = $client->organization()->organizationRoles()->listUsersWithRole('acme', 1); |
| 76 | +``` |
| 77 | + |
| 78 | +Returns a list of users with the role assigned to them. |
| 79 | + |
| 80 | +### Assign a single role to a user in an organization |
| 81 | + |
| 82 | +> Requires [authentication](../security.md). |
| 83 | +
|
| 84 | +```php |
| 85 | +$client->organization()->organizationRoles()->assignRoleToUser('acme', 1, 'admin-user'); |
| 86 | +``` |
| 87 | + |
| 88 | +No content is returned. |
| 89 | + |
| 90 | +### Remove a single role from a user in an organization |
| 91 | + |
| 92 | +> Requires [authentication](../security.md). |
| 93 | +
|
| 94 | +```php |
| 95 | +$client->organization()->organizationRoles()->removeRoleFromUser('acme', 1, 'admin-user'); |
| 96 | +``` |
| 97 | + |
| 98 | +No content is returned. |
| 99 | + |
| 100 | +### Remove all roles from a user in an organization |
| 101 | + |
| 102 | +> Requires [authentication](../security.md). |
| 103 | +
|
| 104 | +```php |
| 105 | +$client->organization()->organizationRoles()->removeAllRolesFromUser('acme', 'admin-user'); |
| 106 | +``` |
| 107 | + |
| 108 | +No content is returned. |
0 commit comments