Adds useful objects to the class and performs security checks.
977955
def dispatch(self, request, *args, **kwargs):
        """"""
        self._add_next_and_user(request)
        self.content_object = None
        self.content_type = None
        self.object_id = kwargs.get('object_id', None)

        if kwargs.get('content_type'):
            # Check if the user forged the URL and posted a non existant
            # content type
            try:
                self.content_type = ContentType.objects.get(
                    model=kwargs.get('content_type'))
            except ContentType.DoesNotExist:
                raise Http404

        if self.content_type:
            # Check if the user forged the URL and tries to append the image to
            # an object that does not exist
            try:
                self.content_object = \
                    self.content_type.get_object_for_this_type(
                        pk=self.object_id)
            except ObjectDoesNotExist:
                raise Http404

        if self.content_object and hasattr(self.content_object, 'user'):
            # Check if the user forged the URL and tries to append the image to
            # an object that does not belong to him
            if not self.content_object.user == self.user:
                raise Http404

        return super(CreateImageView, self).dispatch(request, *args, **kwargs)
605835
def add(self, *obj_or_objs):
        
        objs = obj_or_objs
        if not isinstance(obj_or_objs, (list, tuple)):
            objs = (obj_or_objs, )
        change = operation.Relation(objs, ())
        self.parent.set(self.key, change)
        self.target_class_name = change._target_class_name
1012810
def add_object(self, obj):
        ''''''
        state = self.state
        if not obj.layer in state.layers:
            # its a new layer
            state.layers[obj.layer] = {}
        state.layers[obj.layer][obj.key] = obj
        state.need_redraw = True
870220
def add_class(cls, *args):
        
        for cls2 in args:
            cls.classes[cls2.__name__] = cls2
160539
def add_check(self, check_item):
        """"""
        self.checks.append(check_item)
        for other in self.others:
            other.add_check(check_item)
1306479
protected function initializeObject()
    {
        $assetValidatorImplementationClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface(AssetValidatorInterface::class);
        foreach ($assetValidatorImplementationClassNames as $assetValidatorImplementationClassName) {
            $this->addValidator($this->objectManager->get($assetValidatorImplementationClassName));
        }
    }
164022
def _recursive_reindex_object_security(self, obj):
        
        if hasattr(aq_base(obj), "objectValues"):
            for obj in obj.objectValues():
                self._recursive_reindex_object_security(obj)

        logger.debug("Reindexing object security for {}".format(repr(obj)))
        obj.reindexObjectSecurity()
433692
void addPropertyIfAbsent(final String name, final Object value) {
        final String currentValue = SecurityActions.getPropertyPrivileged(name);
        if (currentValue == null) {
            SecurityActions.setPropertyPrivileged(name, value.toString());
            propertiesToClear.add(name);
        }
    }
944902
def _add(self, codeobj):
        """"""
        assert isinstance(codeobj, (CodeFunction, CodeVariable, CodeClass))
        self.members.append(codeobj)
        codeobj.member_of = self
419321
def add(self, title, obj, **kwargs):
        
        is_class = inspect.isclass(obj)
        self._push(title=title,
                   view=obj,
                   class_name=obj.im_class.__name__ if not is_class else obj.__name__,
                   is_class=is_class,
                   **kwargs)
675870
protected function initialize()
    {
        if (is_array($this->objectIdentifiers)) {
            foreach ($this->objectIdentifiers as $identifier) {
                try {
                    parent::attach($this->persistenceManager->getObjectByIdentifier($identifier));
                } catch (Exception\InvalidObjectDataException $exception) {
                    // when security query rewriting holds back an object here, we skip it...
                }
            }
            $this->objectIdentifiers = null;
        }
    }
888471
private void ensureEntryArrayMutable() {
    checkMutable();
    if (entryList.isEmpty() && !(entryList instanceof ArrayList)) {
      entryList = new ArrayList<Entry>(maxArraySize);
    }
  }
401850
def add_bases(cls, *bases):
    
    assert inspect.isclass(cls), "Expected class object"
    for mixin in bases:
        assert inspect.isclass(mixin), "Expected class object for bases"
    new_bases = (bases + cls.__bases__)
    cls.__bases__ = new_bases
481417
function (checks) {
			checks = checks || [];
			this.checks = [];
			for (var i = 0; i < checks.length; i = i + 1) {
				this.add(checks[i]);
			}
		}
357113
def append(cls, interceptor):
        
        cls._check(interceptor)
        cls._interceptors.append(interceptor)
930827
function( cls ) {
				var classes = this.getCustomData( 'classes' );
				if ( !this.hasClass( cls ) ) {
					!classes && ( classes = [] ), classes.push( cls );
					this.setCustomData( 'classes', classes );
					this.addClass( cls );
				}
			}
1184979
protected function ensureNotEmpty() {
        $this->currentInstance = 0;
        while ($this->classIterator->valid() && !$this->load($this->classIterator->current(), 0)) {
            $this->classIterator->next();
        }
    }