WoltLab/WCF — Issue #446: AbstractDatabaseObjectAction::_validateAndRead()
Author: Gravatronics
Created: 2012-02-25 10:30:09+00:00
State: open

What do you think about a method like this (name just temporary) for `wcf\data\AbstractDatabaseObjectAction`:

```php
checkPermissions($permissions);
}
catch (PermissionDeniedException $e) {
throw new ValidateActionException('Insufficient permissions');
}
}
else {
throw new ValidateActionException('Insufficient permissions');
}

// read objects
if (!count($this->objects)) {
$this->readObjects();
}

if (!count($this->objects)) {
throw new ValidateActionException('Invalid object id');
}
}
```

This method could be called by `validateUpdate` and `validateDelete` and by similar methods with own permissions reducing copy-paste-code.