protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_WEBHOOKS_ENVIRONMENT') && Definition::has(Acl::RESOURCE_WEBHOOKS_ENVIRONMENT); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ADMINISTRATION_WEBHOOKS') && Definition::has(Acl::RESOURCE_ADMINISTRATION_WEBHOOKS); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ORPHANED_SERVERS') && Definition::has(Acl::RESOURCE_ORPHANED_SERVERS); }
protected function validateBefore4($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_CLOUD_CREDENTIALS_ACCOUNT') && Definition::has(Acl::RESOURCE_CLOUD_CREDENTIALS_ACCOUNT); }
/** * Check if stage is applied for the specified resource and permission * * @param string $resourceName The name of the ACL resource (Example:"RESOURCE_FARMS") * @param string $permissionName The name of the ACL permission (Example:"PERM_FARMS_SERVERS") * @return boolean */ private function checkAppliedForPermission($resourceName, $permissionName) { return defined('Scalr\\Acl\\Acl::' . $resourceName) && defined('Scalr\\Acl\\Acl::' . $permissionName) && Definition::has(constant('Scalr\\Acl\\Acl::' . $resourceName)) && $this->db->GetOne("\n SELECT `granted` FROM `acl_role_resource_permissions`\n WHERE `resource_id` = ? AND `role_id` = ? AND `perm_id` = ?\n LIMIT 1\n ", [constant('Scalr\\Acl\\Acl::' . $resourceName), Acl::ROLE_ID_FULL_ACCESS, constant('Scalr\\Acl\\Acl::' . $permissionName)]) == 1; }
protected function validateBefore2($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ADMINISTRATION_ORCHESTRATION') && Definition::has(Acl::RESOURCE_ADMINISTRATION_ORCHESTRATION); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_AWS_ROUTE53') && defined('Scalr\\Acl\\Acl::RESOURCE_ANALYTICS_PROJECTS') && Definition::has(Acl::RESOURCE_AWS_ROUTE53) && Definition::has(Acl::RESOURCE_ANALYTICS_PROJECTS); }
protected function validateBefore2($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ADMINISTRATION_ANALYTICS') && defined('Scalr\\Acl\\Acl::PERM_ADMINISTRATION_ANALYTICS_ALLOCATE_BUDGET') && Definition::has(Acl::RESOURCE_ADMINISTRATION_ANALYTICS) && $this->db->GetOne("\n SELECT `granted` FROM `acl_role_resources`\n WHERE `resource_id` = ? AND `role_id` = ?\n LIMIT 1\n ", array(Acl::RESOURCE_ADMINISTRATION_ANALYTICS, Acl::ROLE_ID_FULL_ACCESS)) == 1; }
protected function validateBefore6($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_FARMS') && Definition::has(Acl::RESOURCE_FARMS) && defined('Scalr\\Acl\\Acl::RESOURCE_TEAM_FARMS') && Definition::has(Acl::RESOURCE_TEAM_FARMS) && defined('Scalr\\Acl\\Acl::RESOURCE_OWN_FARMS') && Definition::has(Acl::RESOURCE_OWN_FARMS) && defined('Scalr\\Acl\\Acl::PERM_FARMS_PROJECTS'); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ADMINISTRATION_GLOBAL_VARIABLES') && Definition::has(Acl::RESOURCE_ADMINISTRATION_GLOBAL_VARIABLES); }
protected function validateBefore2($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ENVADMINISTRATION_ANALYTICS') && Definition::has(Acl::RESOURCE_ENVADMINISTRATION_ANALYTICS); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_FARMS_SERVERS') && defined('Scalr\\Acl\\Acl::PERM_FARMS_SERVERS_SSH_CONSOLE') && Definition::has(Acl::RESOURCE_FARMS_SERVERS) && $this->db->GetOne("\n SELECT `granted` FROM `acl_role_resources`\n WHERE `resource_id` = ? AND `role_id` = ?\n LIMIT 1\n ", array(Acl::RESOURCE_FARMS_SERVERS, Acl::ROLE_ID_FULL_ACCESS)) == 1; }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_GENERAL_CUSTOM_EVENTS') && defined('Scalr\\Acl\\Acl::PERM_GENERAL_CUSTOM_EVENTS_FIRE') && Definition::has(Acl::RESOURCE_GENERAL_CUSTOM_EVENTS) && $this->db->GetOne("\n SELECT `granted` FROM `acl_role_resources`\n WHERE `resource_id` = ? AND `role_id` = ?\n LIMIT 1\n ", array(Acl::RESOURCE_GENERAL_CUSTOM_EVENTS, Acl::ROLE_ID_FULL_ACCESS)) == 1; }
protected function validateBefore4($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_SERVICES_ADMINISTRATION_CHEF') && Definition::has(Acl::RESOURCE_SERVICES_ADMINISTRATION_CHEF); }
protected function validateBefore4($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_FARMS_IMAGES') && defined('Scalr\\Acl\\Acl::PERM_FARMS_IMAGES_CREATE') && Definition::has(Acl::RESOURCE_FARMS_IMAGES); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_GLOBAL_VARIABLES_ACCOUNT') && Definition::has(Acl::RESOURCE_GLOBAL_VARIABLES_ACCOUNT); }
protected function validateBefore3($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_GCE_SNAPSHOTS') && Definition::has(Acl::RESOURCE_GCE_SNAPSHOTS); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_LOGS_EVENT_LOGS') && Definition::has(Acl::RESOURCE_LOGS_EVENT_LOGS); }
protected function validateBefore1($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_DISCOVERY_SERVERS') && Definition::has(Acl::RESOURCE_DISCOVERY_SERVERS) && defined('Scalr\\Acl\\Acl::PERM_DISCOVERY_SERVERS_IMPORT'); }
/** * Gets mnemonic names for all resources using constants * * This method excludes disabled resources. * * @return array Returns all resources looks like array(resourceId => mnemonicIndex) */ public static function getResourcesMnemonic() { $res = array(); $refl = new \ReflectionClass(get_called_class()); foreach ($refl->getConstants() as $name => $resourceId) { if (strpos($name, 'RESOURCE_') === 0 && Resource\Definition::has($resourceId)) { $res[$resourceId] = substr($name, 9); } } //Removes disabled resources foreach (self::getDisabledResources() as $resourceId) { if (isset($res[$resourceId])) { unset($res[$resourceId]); } } return $res; }
protected function validateBefore4($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_SERVICES_CHEF_ACCOUNT') && Definition::has(Acl::RESOURCE_SERVICES_CHEF_ACCOUNT); }
protected function validateBefore2($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_AWS_S3') && Definition::has(Acl::RESOURCE_AWS_S3); }
protected function validateBefore2($stage) { return defined('Scalr\\Acl\\Acl::RESOURCE_ANNOUNCEMENTS') && Definition::has(Acl::RESOURCE_ANNOUNCEMENTS); }