concrete5 /web/concrete/core/models/permission/keys/workflow.php

Language PHP Lines 30
MD5 Hash 185a6231c00ed33ed8be068562a89e12
Repository https://github.com/glockops/concrete5.git View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?
defined('C5_EXECUTE') or die("Access Denied.");
abstract class Concrete5_Model_WorkflowPermissionKey extends PermissionKey {

	public function getCurrentlyActiveUsers(WorkflowProgress $wp) {
		$paa = $this->getPermissionAccessObject();
		if (!$paa) {
			return array();
		}
		$paa->setWorkflowProgressObject($wp);
		$included = $this->getAccessListItems(PermissionKey::ACCESS_TYPE_INCLUDE);
		$excluded = $this->getAccessListItems(PermissionKey::ACCESS_TYPE_EXCLUDE);
		$included = PermissionDuration::filterByActive($included);
		$excluded = PermissionDuration::filterByActive($excluded);
		$users = array();
		$usersExcluded = array();
		foreach($included as $inc) {
			$pae = $inc->getAccessEntityObject();
			$users = array_merge($users, $pae->getAccessEntityUsers($paa));	
		}
		$users = array_unique($users);

		foreach($excluded as $inc) {
			$pae = $inc->getAccessEntityObject();
			$usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers());	
		}
		$users = array_diff($users, $usersExcluded);
		return $users;	
	}
}
Back to Top