mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-01 01:44:08 +00:00
filter boats by permission READ_PUBLIC
This commit is contained in:
1 parent
515c8075e8
commit
5ddb98402e
1 file changed
+14
-2
+14
-2
@@ -5655,12 +5655,24 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
|
||||
@Override
|
||||
public Iterable<BoatDTO> getAllBoats() {
|
||||
return convertToBoatDTOs(getService().getBaseDomainFactory().getCompetitorAndBoatStore().getBoats());
|
||||
List<BoatDTO> result = new ArrayList<>();
|
||||
getSecurityService().filterObjectsWithPermissionForCurrentUser(SecuredDomainType.BOAT,
|
||||
SecuredDomainType.CompetitorAndBoatActions.READ_PUBLIC,
|
||||
getService().getBaseDomainFactory().getCompetitorAndBoatStore().getBoats(),
|
||||
boat -> boat.getIdentifier().toString(),
|
||||
filteredObject -> result.add(baseDomainFactory.convertToBoatDTO(filteredObject)));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<BoatDTO> getStandaloneBoats() {
|
||||
return convertToBoatDTOs(getService().getBaseDomainFactory().getCompetitorAndBoatStore().getStandaloneBoats());
|
||||
List<BoatDTO> result = new ArrayList<>();
|
||||
getSecurityService().filterObjectsWithPermissionForCurrentUser(SecuredDomainType.BOAT,
|
||||
SecuredDomainType.CompetitorAndBoatActions.READ_PUBLIC,
|
||||
getService().getBaseDomainFactory().getCompetitorAndBoatStore().getStandaloneBoats(),
|
||||
boat -> boat.getIdentifier().toString(),
|
||||
filteredObject -> result.add(baseDomainFactory.convertToBoatDTO(filteredObject)));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user