|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Soheilrt\AdobeConnectClient\Client\Commands; |
|
4
|
|
|
|
|
5
|
|
|
use Soheilrt\AdobeConnectClient\Client\Abstracts\Command; |
|
6
|
|
|
use Soheilrt\AdobeConnectClient\Client\Contracts\ArrayableInterface; |
|
7
|
|
|
use Soheilrt\AdobeConnectClient\Client\Converter\Converter; |
|
8
|
|
|
use Soheilrt\AdobeConnectClient\Client\Entities\Principal; |
|
9
|
|
|
use Soheilrt\AdobeConnectClient\Client\Helpers\SetEntityAttributes as FillObject; |
|
10
|
|
|
use Soheilrt\AdobeConnectClient\Client\Helpers\StatusValidate; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Get a list of principals who have permissions to act on a SCO, Principal or Account. |
|
14
|
|
|
* |
|
15
|
|
|
* More info see {@link https://helpx.adobe.com/adobe-connect/webservices/permissions-info.html} |
|
16
|
|
|
*/ |
|
17
|
|
|
class PermissionsInfo extends Command |
|
18
|
|
|
{ |
|
19
|
|
|
/** |
|
20
|
|
|
* @var array |
|
21
|
|
|
*/ |
|
22
|
|
|
protected $parameters; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @var Principal |
|
26
|
|
|
*/ |
|
27
|
|
|
protected $principal; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param int $aclId SCO ID, Principal ID or Account ID |
|
31
|
|
|
* @param ArrayableInterface|null $filter |
|
32
|
|
|
* @param ArrayableInterface|null $sorter |
|
33
|
|
|
*/ |
|
34
|
|
|
public function __construct($aclId, ArrayableInterface $filter = null, ArrayableInterface $sorter = null) |
|
35
|
|
|
{ |
|
36
|
|
|
$this->parameters = [ |
|
37
|
|
|
'action' => 'permissions-info', |
|
38
|
|
|
'acl-id' => (int) $aclId, |
|
39
|
|
|
]; |
|
40
|
|
|
|
|
41
|
|
|
if ($filter) { |
|
42
|
|
|
$this->parameters += $filter->toArray(); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
if ($sorter) { |
|
46
|
|
|
$this->parameters += $sorter->toArray(); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
$this->principal = $this->getEntity('principal'); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* {@inheritdoc} |
|
54
|
|
|
* |
|
55
|
|
|
* @return Principal[] |
|
56
|
|
|
*/ |
|
57
|
|
|
protected function process() |
|
58
|
|
|
{ |
|
59
|
|
|
$response = Converter::convert( |
|
60
|
|
|
$this->client->doGet( |
|
|
|
|
|
|
61
|
|
|
$this->parameters + ['session' => $this->client->getSession()] |
|
|
|
|
|
|
62
|
|
|
) |
|
63
|
|
|
); |
|
64
|
|
|
StatusValidate::validate($response['status']); |
|
65
|
|
|
|
|
66
|
|
|
$principals = []; |
|
67
|
|
|
|
|
68
|
|
|
foreach ($response['permissions'] as $principalAttributes) { |
|
69
|
|
|
$principal = new $this->principal(); |
|
70
|
|
|
FillObject::setAttributes($principal, $principalAttributes); |
|
71
|
|
|
$principals[] = $principal; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
return $principals; |
|
75
|
|
|
} |
|
76
|
|
|
} |
|
77
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.