Skip to content

Commit

Permalink
Filter role list by client
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Nov 12, 2024
1 parent d9b2746 commit ef0d905
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public Long countDatabaseRows() throws DAOException {

@Override
public Long countResults(Map filters) throws DAOException {
if (ServiceManager.getSecurityAccessService().hasAuthorityGlobalToViewRoleList()) {
return countDatabaseRows();
}
if (ServiceManager.getSecurityAccessService().hasAuthorityToViewRoleList()) {
return countDatabaseRows("SELECT COUNT(*) FROM Role AS r INNER JOIN r.client AS c WITH c.id = :clientId",
Collections.singletonMap(CLIENT_ID, ServiceManager.getUserService().getSessionClientId()));
Expand All @@ -86,11 +83,7 @@ public List<Role> getAllForSelectedClient() {
}

@Override
@SuppressWarnings("unchecked")
public List<Role> loadData(int first, int pageSize, String sortField, SortOrder sortOrder, Map filters) {
if (ServiceManager.getSecurityAccessService().hasAuthorityGlobalToViewRoleList()) {
return dao.getByQuery("FROM Role" + getSort(sortField, sortOrder), filters, first, pageSize);
}
if (ServiceManager.getSecurityAccessService().hasAuthorityToViewRoleList()) {
return dao.getByQuery("SELECT r FROM Role AS r INNER JOIN r.client AS c WITH c.id = :clientId"
+ getSort(sortField, sortOrder),
Expand Down

0 comments on commit ef0d905

Please sign in to comment.