Check if object manipulation is allowed
        :param StorageAccount self: this
        :rtype: bool
        :return: if object manipulation is allowed
180695
def _ensure_object_manipulation_allowed(self):
        # type: (StorageAccount) -> bool
        
        if self.is_sas:
            # search for account sas "o" resource
            sasparts = self.key.split('&')
            for part in sasparts:
                tmp = part.split('=')
                if tmp[0] == 'srt':
                    return 'o' in tmp[1]
            # this is a sas without the srt parameter, so this must be
            # a service-level sas which always allows object manipulation
            return True
        else:
            # storage account key always allows object manipulation
            return True
488407
def add_storage_account(self, name, key, endpoint):
        # type: (StorageCredentials, str, str, str) -> None
        
        if name in self._storage_accounts:
            raise ValueError(
                '{} already exists in storage accounts'.format(name))
        self._storage_accounts[name] = StorageAccount(
            name, key, endpoint,
            self._general_options.concurrency.transfer_threads,
            self._general_options.timeout,
            self._general_options.proxy,
        )
53824
private boolean checkForAddOnAccess() {
        Class[] classContext = getClassContext();
        for (Class clazz : classContext) {
            if (clazz.getClassLoader() instanceof IzouPluginClassLoader) {
                return true;
            }
        }
        return false;
    }
250284
def _CompareStores(self, storage_reader, compare_storage_reader):
    
    storage_counters = self._CalculateStorageCounters(storage_reader)
    compare_storage_counters = self._CalculateStorageCounters(
        compare_storage_reader)

    # TODO: improve comparison, currently only total numbers are compared.

    return storage_counters == compare_storage_counters
860885
def check_object_permission(obj):
        """"""
        check_permission(current_permission_factory(
            obj,
            'object-read'
        ))
        if not obj.is_head:
            check_permission(
                current_permission_factory(obj, 'object-read-version'),
                hidden=False
            )
11101
public boolean isDirectChildOfAccount(final Account effectiveAccount,
            final Account operatedAccount) {
        return operatedAccount.getParentSid().equals(effectiveAccount.getSid());
    }
870061
def _CalculateStorageCounters(self, storage_reader):
    
    analysis_reports_counter = collections.Counter()
    analysis_reports_counter_error = False
    event_labels_counter = collections.Counter()
    event_labels_counter_error = False
    parsers_counter = collections.Counter()
    parsers_counter_error = False

    for session in storage_reader.GetSessions():
      # Check for a dict for backwards compatibility.
      if isinstance(session.analysis_reports_counter, dict):
        analysis_reports_counter += collections.Counter(
            session.analysis_reports_counter)
      elif isinstance(session.analysis_reports_counter, collections.Counter):
        analysis_reports_counter += session.analysis_reports_counter
      else:
        analysis_reports_counter_error = True

      # Check for a dict for backwards compatibility.
      if isinstance(session.event_labels_counter, dict):
        event_labels_counter += collections.Counter(
            session.event_labels_counter)
      elif isinstance(session.event_labels_counter, collections.Counter):
        event_labels_counter += session.event_labels_counter
      else:
        event_labels_counter_error = True

      # Check for a dict for backwards compatibility.
      if isinstance(session.parsers_counter, dict):
        parsers_counter += collections.Counter(session.parsers_counter)
      elif isinstance(session.parsers_counter, collections.Counter):
        parsers_counter += session.parsers_counter
      else:
        parsers_counter_error = True

    storage_counters = {}

    warnings_by_path_spec = collections.Counter()
    warnings_by_parser_chain = collections.Counter()

    for warning in list(storage_reader.GetWarnings()):
      warnings_by_path_spec[warning.path_spec.comparable] += 1
      warnings_by_parser_chain[warning.parser_chain] += 1

    storage_counters['warnings_by_path_spec'] = warnings_by_path_spec
    storage_counters['warnings_by_parser_chain'] = warnings_by_parser_chain

    if not analysis_reports_counter_error:
      storage_counters['analysis_reports'] = analysis_reports_counter

    if not event_labels_counter_error:
      storage_counters['event_labels'] = event_labels_counter

    if not parsers_counter_error:
      storage_counters['parsers'] = parsers_counter

    return storage_counters
576999
private void incrementHeaderCounter() {
        this.numberOfHeaders++;
        this.headerAddCount++;
        if (this.limitNumHeaders < this.numberOfHeaders) {
            String msg = "Too many headers in storage: " + this.numberOfHeaders;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, msg);
            }
            throw new IllegalArgumentException(msg);
        }
    }
928467
def put_object_acl(self, bucket, object_name, access_control_policy):
        
        data = access_control_policy.to_xml()
        details = self._details(
            method=b"PUT",
            url_context=self._url_context(
                bucket=bucket, object_name='%s?acl' % (object_name,),
            ),
            body=data,
        )
        query = self._query_factory(details)
        d = self._submit(query)
        d.addCallback(self._parse_acl)
        return d
428026
def _check_load_parameters(self, **kwargs):
        

        if 'partition' in kwargs:
            msg = "'partition' is not allowed as a load parameter. Vcmp " \
                "guests are accessed by name."
            raise DisallowedReadParameter(msg)
        super(Virtual_Disk, self)._check_load_parameters(**kwargs)
1308247
function(objects, user) {
    if (!_.isArray(objects)) {
      return PermissionService.isForeignObject(user.id)(objects);
    }
    return _.any(objects, PermissionService.isForeignObject(user.id));
  }
485295
public function checkIntegrityData()
    {
        $prevId = 0;
        $identifier = $this->getIdentifier();

        foreach ($this as $item) {
            $this->checkIdentifierType($item[$identifier]);

            if ($item[$identifier] < $prevId) {
                throw new DataStoreException("This storage type supports only a list ordered by id ASC");
            }

            $prevId = $item[$identifier];
        }

        return true;
    }
1111298
static void ensureAccessible(AccessibleObject accessibleObject) {
        if (accessibleObject != null) {
            if (!accessibleObject.isAccessible()) {
                if (System.getSecurityManager() != null) {
                    AccessController.doPrivileged(SetAccessibleAction.of(accessibleObject));
                } else {
                    accessibleObject.setAccessible(true);
                }
            }
        }
    }
177073
def access_storage_rm(name, yes, **kwargs):
    
    if name is None:
        if not yes:
            click.confirm('Are you sure you want to remove all ACL?', abort=True)

    ctx = Context(**kwargs)
    ctx.execute_action('access:storage:rm', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
1220435
async def azureAccounts(self, *args, **kwargs):
        

        return await self._makeApiCall(self.funcinfo["azureAccounts"], *args, **kwargs)
1177223
def endpoint(self, value):
        # type: (StorageAccount, str) -> None
        
        tmp = value.split('.')
        if (len(tmp) <= 1 or not tmp[0].isalnum()):
            raise ValueError('endpoint is invalid: {}'.format(value))
        self._endpoint = value
956235
private void checkInitialized()
        throws StorageException {
        if (storageAccountManager == null || !storageAccountManager.isInitialized()) {
            String error = "DuraStore must be initialized with an XML file " +
                           "containing storage account information before any " +
                           "further requests can be fulfilled.";
            throw new StorageException(error);
        }
    }