bug5510: Introduced new PrototypeRole StreamletViewerRole

This commit is contained in:
Dennis Aulenbacher
2021-04-06 15:15:23 +02:00
parent 44eb93b8a5
commit 6f03ffb621
2 changed files with 30 additions and 1 deletions
@@ -53,7 +53,8 @@ public class SecuredDomainType extends HasPermissionsImpl {
public static enum TrackedRaceActions implements Action {
CAN_REPLAY_DURING_LIVE_RACES,
DETAIL_TIMER,
EXPORT;
EXPORT,
VIEWSTREAMLETS;
private static final Action[] ALL_ACTIONS = DefaultActions.plus(CAN_REPLAY_DURING_LIVE_RACES, DETAIL_TIMER,
EXPORT);
@@ -0,0 +1,28 @@
package com.sap.sailing.server.security;
import java.util.UUID;
import com.sap.sailing.domain.common.security.SecuredDomainType;
import com.sap.sse.security.shared.RolePrototype;
import com.sap.sse.security.shared.WildcardPermission;
/**
* Specifies a role that when associated to a user gives access to the streamlet Feature on the RaceMap
*/
public class StreamletViewerRole extends RolePrototype {
protected static final UUID ROLE_ID = UUID.fromString("f7912343-2091-4925-b815-8f68a4414eff");
private static final long serialVersionUID = 3291793984984443193L;
private static final StreamletViewerRole INSTANCE = new StreamletViewerRole();
StreamletViewerRole() {
super("streamlet_viewer", ROLE_ID.toString(),
WildcardPermission.builder().withTypes(SecuredDomainType.TRACKED_RACE)
.withActions(SecuredDomainType.TrackedRaceActions.VIEWSTREAMLETS).build());
}
public static StreamletViewerRole getInstance() {
return INSTANCE;
}
}