Skip to content

Commit 310ea74

Browse files
committed
Adjusting ACLs for external group management.
1 parent f11dc27 commit 310ea74

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

app/V1Module/security/TokenScope.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class TokenScope
4343
public const EMAIL_VERIFICATION = "email-verification";
4444

4545
/**
46-
* Scope used for 3rd party tools designed to externally manage groups and student memeberships.
46+
* Scope used for 3rd party tools designed to externally manage groups and student memberships.
4747
*/
48-
public const GROUP_EXTERNAL_ATTRIBUTES = "group-external-attributes";
48+
public const GROUP_EXTERNAL = "group-external";
4949

5050
/**
5151
* Scope for managing the users. Used in case the user data needs to be updated from an external database.

app/config/permissions.neon

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,11 @@ permissions:
7575
- viewDetail
7676

7777
- allow: true
78-
role: scope-group-external-attributes
78+
role: scope-group-external
7979
resource: group
8080
actions:
8181
- viewExternalAttributes
8282
- setExternalAttributes
83-
- viewStudents
84-
- viewAll
85-
- viewPublicDetail
86-
- viewDetail
8783
- addStudent
8884
- removeStudent
8985
- addMember

tests/Presenters/GroupExternalAttributesPresenter.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TestGroupExternalAttributesPresenter extends Tester\TestCase
6666

6767
public function testGetGroupsNoUser()
6868
{
69-
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL_ATTRIBUTES]);
69+
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL]);
7070
$groups = $this->presenter->groups->findBy(['archivedAt' => null]);
7171
Assert::true(count($groups) > 0);
7272
$instanceId = $groups[0]->getInstance()->getId();
@@ -120,7 +120,7 @@ class TestGroupExternalAttributesPresenter extends Tester\TestCase
120120

121121
public function testGetGroupsStudent()
122122
{
123-
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL_ATTRIBUTES]);
123+
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL]);
124124
$users = $this->users->findBy(['email' => PresenterTestHelper::STUDENT_GROUP_MEMBER_LOGIN]);
125125
Assert::count(1, $users);
126126
$user = current($users);
@@ -153,7 +153,7 @@ class TestGroupExternalAttributesPresenter extends Tester\TestCase
153153

154154
public function testGetGroupsTeacher()
155155
{
156-
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL_ATTRIBUTES]);
156+
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL]);
157157
$users = $this->users->findBy(['email' => PresenterTestHelper::GROUP_SUPERVISOR_LOGIN]);
158158
Assert::count(1, $users);
159159
$user = current($users);
@@ -186,7 +186,7 @@ class TestGroupExternalAttributesPresenter extends Tester\TestCase
186186

187187
public function testGetAttributesAdd()
188188
{
189-
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL_ATTRIBUTES]);
189+
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL]);
190190
$attributes = $this->presenter->groupExternalAttributes->findAll();
191191
Assert::count(5, $attributes);
192192
$attribute = current($attributes);
@@ -214,7 +214,7 @@ class TestGroupExternalAttributesPresenter extends Tester\TestCase
214214

215215
public function testGetAttributesRemove()
216216
{
217-
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL_ATTRIBUTES]);
217+
PresenterTestHelper::loginDefaultAdmin($this->container, [TokenScope::GROUP_EXTERNAL]);
218218
$attributes = $this->presenter->groupExternalAttributes->findAll();
219219
Assert::count(5, $attributes);
220220
$attribute = current($attributes);

0 commit comments

Comments
 (0)