fixed bug with caseworker home page stuff
This commit is contained in:
parent
c03683d819
commit
0f93be7071
@ -20,12 +20,12 @@ function opencase_form_user_login_form_alter(&$form, FormStateInterface $form_st
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user does not have permissions to see all cases, then when the login they are
|
||||
* redirected to a view of just their own cases.
|
||||
* If the user has permission to see all cases, then when the login they are
|
||||
* redirected to the all cases view.
|
||||
*/
|
||||
function opencase_user_login_form_submit($form, FormStateInterface $form_state) {
|
||||
if (!\Drupal::currentUser()->hasPermission('view published case entities')) {
|
||||
$form_state->setRedirectUrl(Url::fromRoute('view.cases_by_provider.page_1'));
|
||||
if (Drupal::currentUser()->hasPermission('view published case entities')) {
|
||||
$form_state->setRedirectUrl( Url::fromUserInput('/opencase/cases/all'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ class OpencaseSubscriber implements EventSubscriberInterface {
|
||||
return $this->currentUserCanSeeAllCases();
|
||||
}
|
||||
private function currentUserCanSeeAllCases():bool {
|
||||
return \Drupal::currentUser()->hasPermission('view all published case entities');
|
||||
return \Drupal::currentUser()->hasPermission('view published case entities');
|
||||
}
|
||||
|
||||
private function redirectToAlternativeHomePage(GetResponseEvent $event):void {
|
||||
|
Reference in New Issue
Block a user