Skip to content

Commit

Permalink
Revert to previous permission check; remove unassign button instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Apr 1, 2024
1 parent cad4f2a commit f4e0fdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application/src/Api/Adapter/ItemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function hydrate(Request $request, EntityInterface $entity,
if (!$append && !$remove) {
// Remove sites that were not included in the passed data.
foreach ($sites as $site) {
if (!in_array($site, $sitesToRetain)) {
if (!in_array($site, $sitesToRetain) && $acl->userIsAllowed($site, 'can-assign-items')) {
$sites->removeElement($site);
}
}
Expand Down
7 changes: 1 addition & 6 deletions application/view/omeka/admin/item/manage-sites.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ $siteTemplate = '
<tr class="resource-row">
<td class="data-value" data-row-key="child-search"><?php echo $this->escapeHtml($site->title()); ?></td>
<td class="data-value" data-row-key="resource-email"><?php echo $this->escapeHtml($site->owner()->email()); ?></td>
<td>
<ul class="actions">
<li><?php echo $this->hyperlink('', '#', ['class' => 'o-icon-delete', 'title' => $this->translate('Unassign from site')]); ?></li>
</ul>
<input type="hidden" name="o:site[]" class="resource-id" value="<?php echo $this->escapeHtml($site->id()); ?>">
</td>
<td></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down

0 comments on commit f4e0fdd

Please sign in to comment.