mirror of
https://github.com/grocy/grocy.git
synced 2025-08-13 01:06:23 +00:00
Fixed API key deletion was not possible (fixes #1203)
This commit is contained in:
@@ -50,7 +50,7 @@ class GenericEntityApiController extends BaseApiController
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_MASTER_DATA_EDIT);
|
||||
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoEdit($args['entity']))
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoDelete($args['entity']))
|
||||
{
|
||||
if ($this->IsEntityWithEditRequiresAdmin($args['entity']))
|
||||
{
|
||||
@@ -219,6 +219,11 @@ class GenericEntityApiController extends BaseApiController
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntityNoEdit->enum);
|
||||
}
|
||||
|
||||
private function IsEntityWithNoDelete($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntityNoDelete->enum);
|
||||
}
|
||||
|
||||
private function IsValidExposedEntity($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntity->enum);
|
||||
|
Reference in New Issue
Block a user