Add permission check for managing entities in DeleteEntity request handler
This commit is contained in:
parent
19b932904a
commit
fc6014b37e
1 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,12 @@
|
|||
*/
|
||||
public static function handleRequest(): void
|
||||
{
|
||||
$authenticatedOperator = FederationServer::getAuthenticatedOperator();
|
||||
if(!$authenticatedOperator->canManageBlacklist())
|
||||
{
|
||||
throw new RequestException('Unauthorized: Insufficient permissions to manage entities', 401);
|
||||
}
|
||||
|
||||
if(!preg_match('#^/entities/([a-fA-F0-9\-]{36,})$#', FederationServer::getPath(), $matches))
|
||||
{
|
||||
throw new RequestException('Bad Request: Entity UUID is required', 400);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue