CSS for Accreditation Count form, and some other changes
This commit is contained in:
@ -40,6 +40,9 @@ view published case entities:
|
||||
view unpublished case entities:
|
||||
title: 'View unpublished Case entities'
|
||||
|
||||
view unpublished actor entities:
|
||||
title: 'View unpublished Actor entities'
|
||||
|
||||
view all case revisions:
|
||||
title: 'View all Case revisions'
|
||||
|
||||
|
@ -58,7 +58,11 @@ class OCActorForm extends ContentEntityForm {
|
||||
'%label' => $entity->label(),
|
||||
]));
|
||||
}
|
||||
$form_state->setRedirect('entity.oc_actor.canonical', ['oc_actor' => $entity->id()]);
|
||||
// If you have unpublished the entity and you can't see unpublished entities, redirect to a more informative message than just "Access Denied".
|
||||
if (!$form_state->getValue('status')['value'] && !\Drupal::currentUser()->hasPermission('view unpublished actor entities')) {
|
||||
$form_state->setRedirect('entity.node.canonical', ['node' => 1]);
|
||||
} else {
|
||||
$form_state->setRedirect('entity.oc_actor.canonical', ['oc_actor' => $entity->id()]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class OCActorAccessControlHandler extends EntityAccessControlHandler {
|
||||
case 'view':
|
||||
if (!$entity->isPublished()) {
|
||||
return AccessResult::allowedIf(
|
||||
$account->hasPermission("view unpublished $bundle entities")
|
||||
$account->hasPermission("view unpublished actor entities")
|
||||
);
|
||||
}
|
||||
return AccessResult::allowedIf(
|
||||
|
Reference in New Issue
Block a user