Skip to content

Commit 8e4d95a

Browse files
committed
added possibility to get ProjectUser by test Id
1 parent a03691c commit 8e4d95a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/main/controllers/Project/TestController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public TestDto create(TestDto template) throws AqualityException {
4646
}
4747

4848
public List<TestDto> get(TestDto template, boolean withChildren) throws AqualityException {
49-
if(baseUser.isFromGlobalManagement() || baseUser.getProjectUser(template.getProject_id()).isViewer()){
49+
if(baseUser.isFromGlobalManagement() || baseUser.getProjectUserByTestId(template.getProject_id()).isViewer()){
5050
return fillTests(testDao.searchAll(template), withChildren);
5151
}else{
5252
throw new AqualityPermissionsException("Account is not allowed to view Milestones", baseUser);
@@ -60,7 +60,7 @@ public List<TestDto> get(TestDto template) throws AqualityException {
6060

6161
@Override
6262
public boolean delete(TestDto template) throws AqualityException {
63-
if(baseUser.isManager() || baseUser.getProjectUserByTestId(template.getProject_id()).isEditor()){
63+
if(baseUser.isManager() || baseUser.getProjectUser(template.getProject_id()).isEditor()){
6464
return testDao.delete(template);
6565
}else{
6666
throw new AqualityPermissionsException("Account is not allowed to delete Test", baseUser);

0 commit comments

Comments
 (0)