public function __construct($roleId = 0) { if (!is_int($roleId)) { throw new Exception("No valid role id provided. Role id must be an integer", 500); } // Role information $roleInfo = Role::getRoleInfo($roleId); $this->id = $roleId; $this->label = $roleInfo['name']; // Rules that are maintained by this role $this->maintains = (array) $roleInfo['ruleNames']; // Editable concepts $this->editableConcepts = (array) $roleInfo['editableConcepts']; // Interfaces that are accessible by this role foreach (InterfaceObject::getAllInterfaceObjects() as $ifc) { if (in_array($this->label, $ifc->interfaceRoles) || empty($ifc->interfaceRoles)) { $this->interfaces[] = $ifc; } } }
public static function getPublicInterfaces() { $interfaces = array(); foreach (InterfaceObject::getAllInterfaceObjects() as $ifc) { if (empty($ifc->interfaceRoles)) { $interfaces[$ifc->id] = $ifc; } } return $interfaces; }
public static function getAllInterfacesForConcept($concept) { $interfaces = array(); foreach (InterfaceObject::getAllInterfaceObjects() as $interfaceId => $interface) { if ($interface['srcConcept'] == $concept) { $interfaces[] = $interfaceId; } } return $interfaces; }