1: <?php
2:
3: namespace Cloudflare\Organizations;
4:
5: use Cloudflare\Api;
6: use Cloudflare\Organizations;
7:
8: /**
9: * CloudFlare API wrapper
10: *
11: * Organization Roles
12: *
13: * @author James Bell <[email protected]>
14: *
15: * @version 1
16: */
17: class Roles extends Api
18: {
19: /**
20: * Default permissions level
21: *
22: * @var array
23: */
24: protected $permission_level = ['read' => '#organization:read', 'edit' => '#organization:edit'];
25:
26: /**
27: * List roles (permission needed: #organization:read)
28: * Get all available roles for an organization
29: *
30: * @param string $organization_identifier
31: */
32: public function roles($organization_identifier)
33: {
34: return $this->get('/organizations/'.$organization_identifier.'/roles');
35: }
36:
37: /**
38: * Role details (permission needed: #organization:read)
39: * Get information about a specific role for an organization
40: *
41: * @param string $organization_identifier
42: * @param string $identifier
43: */
44: public function details($organization_identifier, $identifier)
45: {
46: return $this->get('/organizations/'.$organization_identifier.'/roles/'.$identifier);
47: }
48: }
49: