diff --git a/src/CoreBundle/EventListener/CourseListener.php b/src/CoreBundle/EventListener/CourseListener.php index 5fa6affff7..8f92454ca3 100644 --- a/src/CoreBundle/EventListener/CourseListener.php +++ b/src/CoreBundle/EventListener/CourseListener.php @@ -143,7 +143,7 @@ class CourseListener // See CourseVoter.php //dump("Checkisgranted"); if (false === $checker->isGranted(CourseVoter::VIEW, $course)) { - throw new AccessDeniedException($translator->trans('Unauthorised access to course!')); + throw new AccessDeniedException($translator->trans('You\'re not allowed in this course')); } } else { //dump("Load chamilo session from DB"); @@ -157,7 +157,7 @@ class CourseListener // Check if user is allowed to this course-session // See SessionVoter.php if (false === $checker->isGranted(SessionVoter::VIEW, $session)) { - throw new AccessDeniedException($translator->trans('Unauthorised access to session!')); + throw new AccessDeniedException($translator->trans('You\'re not allowed in this session')); } $sessionHandler->set('session_name', $session->getName()); $sessionHandler->set('sid', $session->getId()); @@ -183,7 +183,7 @@ class CourseListener } if (false === $checker->isGranted(GroupVoter::VIEW, $group)) { - throw new AccessDeniedException($translator->trans('Unauthorised access to group')); + throw new AccessDeniedException($translator->trans('You\'re not allowed in this group')); } $sessionHandler->set('gid', $groupId); diff --git a/tests/behat/features/sessionAccess.feature b/tests/behat/features/sessionAccess.feature index 46ce8ffb98..4dc6836872 100644 --- a/tests/behat/features/sessionAccess.feature +++ b/tests/behat/features/sessionAccess.feature @@ -65,7 +65,7 @@ Feature: Session access Given I am logged as "ywarnier" Then I am on course "TEMPPRIVATE" homepage in session "Session2" And wait the page to be loaded when ready - Then I should see "Unauthorised access" + Then I should see "not allowed" Scenario: ywarnier connect to course TEMPPRIVATE inside a session that doesn't exists Given I am not logged @@ -79,7 +79,7 @@ Feature: Session access Given I am logged as "mmosquera" Then I am on course "TEMPPRIVATE" homepage in session "Session1" And wait the page to be loaded when ready - Then I should see "Unauthorised access" + Then I should see "not allowed" Scenario: mmosquera connect to Session 2 Given I am not logged diff --git a/tests/behat/features/toolGroup.feature b/tests/behat/features/toolGroup.feature index 24e18ed1e7..9f4cbd9847 100644 --- a/tests/behat/features/toolGroup.feature +++ b/tests/behat/features/toolGroup.feature @@ -396,11 +396,11 @@ Feature: Group tool And I should see "Group 0003" And I should see "Group 0004" Then I visit URL saved with name "announcement_for_user_fapple_group_0001_public" - Then I should see "Exception" + Then I should see "not allowed" Then I visit URL saved with name "announcement_for_all_users_group_0001_public" - Then I should not see "Exception" + Then I should not see "not allowed" Then I visit URL saved with name "announcement_only_for_fapple_private" - Then I should not see "Exception" + Then I should not see "not allowed" Given I am not logged Given I am logged as "acostea" @@ -413,12 +413,12 @@ Feature: Group tool And I should see "Group 0005" Then I visit URL saved with name "announcement_for_user_fapple_group_0001_public" - Then I should see "Exception" + Then I should see "not allowed" Then I visit URL saved with name "announcement_for_all_users_group_0001_public" - Then I should not see "Exception" + Then I should not see "not allowed" Then I visit URL saved with name "announcement_for_user_fapple_group_0003_private" - Then I should see "Exception" + Then I should see "not allowed" Then I visit URL saved with name "announcement_for_all_users_group_0003_private" - Then I should see "Exception" + Then I should see "not allowed" Then I visit URL saved with name "announcement_only_for_fapple_private" - Then I should not see "Exception" \ No newline at end of file + Then I should not see "not allowed" \ No newline at end of file