Skip to content

Commit

Permalink
Give admin of automated tests permission to use mass import
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Aug 29, 2024
1 parent 43b61a9 commit 621af0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Kitodo/src/test/java/org/kitodo/MockDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ public static void insertAuthorities() throws DAOException {
// Assign import configurations to clients
authorities.add(new Authority("assignImportConfigurationToClient" + GLOBAL_ASSIGNABLE));

// Use mass import
authorities.add(new Authority("useMassImport" + CLIENT_ASSIGNABLE));

for (Authority authority : authorities) {
ServiceManager.getAuthorityService().saveToDatabase(authority);
}
Expand Down Expand Up @@ -1540,6 +1543,9 @@ private static void insertRoles() throws DAOException {
firstRole.getAuthorities().add(allAuthorities.get(i));
}

firstRole.setAuthorities(Collections.singletonList(ServiceManager.getAuthorityService()
.getByTitle("useMassImport" + CLIENT_ASSIGNABLE)));

ServiceManager.getRoleService().saveToDatabase(firstRole);

Role secondRole = new Role();
Expand Down

0 comments on commit 621af0b

Please sign in to comment.