Skip to content

Commit

Permalink
Add permissions and locked status to grid items
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Jan 9, 2025
1 parent 3d2b2b4 commit 2d8beae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Grid/Service/GridService.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public function getGridDataForElement(
);

$data['columns'][] = $columnData;
$data['isLocked'] = $element->getIsLocked();
$data['permissions'] = $element->getPermissions();
}

return $data;
Expand Down
7 changes: 6 additions & 1 deletion src/Response/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use OpenApi\Attributes\Property;
use OpenApi\Attributes\Schema;
use Pimcore\Bundle\StudioBackendBundle\Element\Schema\Permissions;

/**
* @internal
Expand All @@ -34,7 +35,6 @@
'isLocked',
'creationDate',
'modificationDate',
'permissions',
],
type: 'object'
)]
Expand Down Expand Up @@ -113,4 +113,9 @@ public function getIsLocked(): bool
{
return $this->isLocked;
}

public function getPermissions(): Permissions
{
return new Permissions();
}
}
4 changes: 4 additions & 0 deletions src/Response/ElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace Pimcore\Bundle\StudioBackendBundle\Response;

use Pimcore\Bundle\StudioBackendBundle\Element\Schema\Permissions;

/**
* @internal
*/
Expand All @@ -40,4 +42,6 @@ public function getUserOwner(): int;
public function getLocked(): ?string;

public function getIsLocked(): bool;

public function getPermissions(): Permissions;
}

0 comments on commit 2d8beae

Please sign in to comment.