mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 22:43:57 +00:00
Merge branch 'permission-vertical' into bug4813
This commit is contained in:
commit
45dafda54e
16 files changed
+283
-22
No files matched your search
@@ -23,8 +23,13 @@ public class BranchIO {
|
||||
if (parameters != null && parameters.size() > 0) {
|
||||
deepLinkUrl.append("?");
|
||||
}
|
||||
boolean first = true;
|
||||
for (Entry<String, String> param : parameters.entrySet()) {
|
||||
if (!first) {
|
||||
deepLinkUrl.append("&");
|
||||
}
|
||||
deepLinkUrl.append(param.getKey()).append(("=")).append(urlEncoder.attributeEncode(param.getValue()));
|
||||
first = false;
|
||||
}
|
||||
return deepLinkUrl.toString();
|
||||
}
|
||||
|
||||
+3
@@ -56,6 +56,9 @@ public class SecuredDomainType extends HasPermissionsImpl {
|
||||
private static final Action[] ALL_ACTIONS = new Action[] { READ_PUBLIC, DefaultActions.READ,
|
||||
DefaultActions.CREATE, DefaultActions.UPDATE, DefaultActions.CHANGE_OWNERSHIP,
|
||||
DefaultActions.CHANGE_ACL };
|
||||
|
||||
public static final Action[] MUTATION_ACTIONS = new Action[] { DefaultActions.CREATE, DefaultActions.UPDATE,
|
||||
DefaultActions.CHANGE_OWNERSHIP, DefaultActions.CHANGE_ACL };
|
||||
};
|
||||
|
||||
public static final HasPermissions COMPETITOR = new SecuredDomainType("COMPETITOR", IdentifierStrategy.ID, CompetitorAndBoatActions.ALL_ACTIONS);
|
||||
|
||||
+10
-14
@@ -13,6 +13,7 @@ import com.google.gwt.user.client.ui.HeaderPanel;
|
||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.security.SecuredDomainType;
|
||||
import com.sap.sailing.domain.common.security.SecuredDomainType.CompetitorAndBoatActions;
|
||||
import com.sap.sailing.gwt.common.authentication.FixedSailingAuthentication;
|
||||
import com.sap.sailing.gwt.common.authentication.SAPSailingHeaderWithAuthentication;
|
||||
import com.sap.sailing.gwt.ui.client.AbstractSailingEntryPoint;
|
||||
@@ -119,7 +120,9 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
leaderboardsDisplayers = new HashSet<>();
|
||||
leaderboardGroupsDisplayers = new HashSet<>();
|
||||
|
||||
final EventManagementPanel eventManagementPanel = new EventManagementPanel(getSailingService(), getUserService(), this, this, getStringMessages(), panel);
|
||||
/* EVENTS */
|
||||
final EventManagementPanel eventManagementPanel = new EventManagementPanel(getSailingService(),
|
||||
getUserService(), this, this, getStringMessages(), panel);
|
||||
eventManagementPanel.ensureDebugId("EventManagement");
|
||||
panel.addToVerticalTabPanel(new DefaultRefreshableAdminConsolePanel<EventManagementPanel>(eventManagementPanel) {
|
||||
@Override
|
||||
@@ -127,11 +130,10 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
getWidget().fillEvents();
|
||||
fillLeaderboardGroups();
|
||||
}
|
||||
}, getStringMessages().events()); // no permissions required; we show those events the user may read
|
||||
}, getStringMessages().events(), SecuredDomainType.EVENT.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
leaderboardGroupsDisplayers.add(eventManagementPanel);
|
||||
|
||||
/* REGATTAS */
|
||||
|
||||
RegattaManagementPanel regattaManagementPanel = new RegattaManagementPanel(
|
||||
getSailingService(), getUserService(), this, getStringMessages(), this, eventManagementPanel);
|
||||
regattaManagementPanel.ensureDebugId("RegattaStructureManagement");
|
||||
@@ -140,11 +142,10 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
public void refreshAfterBecomingVisible() {
|
||||
fillRegattas();
|
||||
}
|
||||
}, getStringMessages().regattas(), SecuredDomainType.EVENT.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
}, getStringMessages().regattas(), SecuredDomainType.REGATTA.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
regattasDisplayers.add(regattaManagementPanel);
|
||||
|
||||
/* LEADERBOARDS */
|
||||
|
||||
final HorizontalTabLayoutPanel leaderboardTabPanel = panel.addVerticalTab(getStringMessages().leaderboards(), "LeaderboardPanel");
|
||||
final LeaderboardConfigPanel leaderboardConfigPanel = new LeaderboardConfigPanel(getSailingService(), getUserService(), this, this,
|
||||
getStringMessages(), /* showRaceDetails */true, this);
|
||||
@@ -179,9 +180,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
leaderboardsDisplayers.add(leaderboardGroupConfigPanel);
|
||||
|
||||
/* RACES */
|
||||
|
||||
final HorizontalTabLayoutPanel racesTabPanel = panel.addVerticalTab(getStringMessages().trackedRaces(), "RacesPanel");
|
||||
racesTabPanel.ensureDebugId("RacesPanel");
|
||||
|
||||
final TrackedRacesManagementPanel trackedRacesManagementPanel = new TrackedRacesManagementPanel(
|
||||
getSailingService(), getUserService(), this, this, getStringMessages());
|
||||
@@ -201,7 +200,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshCompetitorList();
|
||||
}
|
||||
}, getStringMessages().competitors()); // no permissions required; we show those competitors the user may read
|
||||
}, getStringMessages().competitors(), SecuredDomainType.COMPETITOR.getPermission(CompetitorAndBoatActions.MUTATION_ACTIONS));
|
||||
|
||||
final BoatPanel boatPanel = new BoatPanel(getSailingService(), getUserService(), getStringMessages(), this);
|
||||
boatPanel.ensureDebugId("BoatPanel");
|
||||
@@ -210,7 +209,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshBoatList();
|
||||
}
|
||||
}, getStringMessages().boats()); // no permissions required; we show those boats the user may read
|
||||
}, getStringMessages().boats(), SecuredDomainType.BOAT.getPermission(CompetitorAndBoatActions.MUTATION_ACTIONS));
|
||||
|
||||
RaceCourseManagementPanel raceCourseManagementPanel = new RaceCourseManagementPanel(getSailingService(), this, this, getStringMessages());
|
||||
panel.addToTabPanel(racesTabPanel, new DefaultRefreshableAdminConsolePanel<RaceCourseManagementPanel>(raceCourseManagementPanel), getStringMessages().courseLayout());
|
||||
@@ -231,7 +230,6 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
}, getStringMessages().mediaPanel()); // no permissions required; we show those media the user may read
|
||||
|
||||
/* RACE COMMITTEE APP */
|
||||
|
||||
final HorizontalTabLayoutPanel raceCommitteeTabPanel = panel.addVerticalTab(getStringMessages().raceCommitteeApp(), "RaceCommiteeAppPanel");
|
||||
final DeviceConfigurationUserPanel deviceConfigurationUserPanel = new DeviceConfigurationUserPanel(getSailingService(),
|
||||
getUserService(), getStringMessages(), this);
|
||||
@@ -239,7 +237,6 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
getStringMessages().deviceConfiguration()); // no permissions required; we show those device configurations the user may read
|
||||
|
||||
/* CONNECTORS */
|
||||
|
||||
final HorizontalTabLayoutPanel connectorsTabPanel = panel.addVerticalTab(getStringMessages().connectors(), "TrackingProviderPanel");
|
||||
TracTracEventManagementPanel tractracEventManagementPanel = new TracTracEventManagementPanel(getSailingService(),
|
||||
this, this, getStringMessages());
|
||||
@@ -297,9 +294,8 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint
|
||||
SecuredDomainType.REGATTA.getPermission(DefaultActions.CREATE)); // TODO bug4763 provide the default CREATE ownership for REGATTA / EVENT
|
||||
|
||||
/* ADVANCED */
|
||||
|
||||
final HorizontalTabLayoutPanel advancedTabPanel = panel.addVerticalTab(getStringMessages().advanced(), "AdvancedPanel");
|
||||
advancedTabPanel.ensureDebugId("AdvancedTab");
|
||||
final HorizontalTabLayoutPanel advancedTabPanel = panel.addVerticalTab(getStringMessages().advanced(),
|
||||
"AdvancedTab");
|
||||
final ReplicationPanel replicationPanel = new ReplicationPanel(getSailingService(), this, getStringMessages());
|
||||
panel.addToTabPanel(advancedTabPanel, new DefaultRefreshableAdminConsolePanel<ReplicationPanel>(replicationPanel) {
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -105,7 +105,8 @@ public class EventsResource extends AbstractSailingServerResource {
|
||||
}
|
||||
|
||||
@POST
|
||||
public Response migrateOwnershipForEvent(@QueryParam("eventId") UUID eventId,
|
||||
@Path("/{eventId}/migrate")
|
||||
public Response migrateOwnershipForEvent(@PathParam("eventId") UUID eventId,
|
||||
@QueryParam("createNewGroup") Boolean createNewGroup,
|
||||
@QueryParam("existingGroupId") UUID existingGroupIdOrNull, @QueryParam("newGroupName") String newGroupName,
|
||||
@QueryParam("migrateCompetitors") Boolean migrateCompetitors,
|
||||
|
||||
+2
-1
@@ -45,7 +45,8 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
@Path("/v1/leaderboardgroups")
|
||||
public class LeaderboardGroupsResource extends AbstractSailingServerResource {
|
||||
@POST
|
||||
public Response migrateOwnershipForLeaderboardGroup(@QueryParam("leaderboardGroupName") String leaderboardGroupName,
|
||||
@Path("/{name}/migrate")
|
||||
public Response migrateOwnershipForLeaderboardGroup(@PathParam("name") String leaderboardGroupName,
|
||||
@QueryParam("createNewGroup") Boolean createNewGroup,
|
||||
@QueryParam("existingGroupId") UUID existingGroupIdOrNull, @QueryParam("newGroupName") String newGroupName,
|
||||
@QueryParam("migrateCompetitors") Boolean migrateCompetitors,
|
||||
|
||||
+2
-1
@@ -56,7 +56,8 @@ import com.sap.sse.common.Util.Pair;
|
||||
@Path("/v2/leaderboards")
|
||||
public class LeaderboardsResourceV2 extends AbstractLeaderboardsResource {
|
||||
@POST
|
||||
public Response migrateOwnershipForLeaderboard(@QueryParam("leaderboardName") String leaderboardName,
|
||||
@Path("/{name}/migrate")
|
||||
public Response migrateOwnershipForLeaderboard(@PathParam("name") String leaderboardName,
|
||||
@QueryParam("createNewGroup") Boolean createNewGroup,
|
||||
@QueryParam("existingGroupId") UUID existingGroupIdOrNull, @QueryParam("newGroupName") String newGroupName,
|
||||
@QueryParam("migrateCompetitors") Boolean migrateCompetitors,
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ public class RestApiApplication extends Application {
|
||||
classes.add(MarkRessource.class);
|
||||
classes.add(PreferencesResource.class);
|
||||
classes.add(TagsResource.class);
|
||||
classes.add(UserGroupsResource.class);
|
||||
|
||||
// Exception Mappers
|
||||
classes.add(ShiroAuthorizationExceptionTo401ResponseMapper.class);
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.sap.sailing.server.gateway.jaxrs.api;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException;
|
||||
import com.sap.sailing.server.gateway.jaxrs.AbstractSailingServerResource;
|
||||
import com.sap.sse.security.shared.impl.User;
|
||||
import com.sap.sse.security.shared.impl.UserGroup;
|
||||
|
||||
@Path("/v1/usergroups")
|
||||
public class UserGroupsResource extends AbstractSailingServerResource {
|
||||
@GET
|
||||
@Produces("application/json;charset=UTF-8")
|
||||
public Response getUserGroupsCurrentUserIsPartOf()
|
||||
throws ParseException, JsonDeserializationException {
|
||||
Response response = null;
|
||||
User user = getService().getSecurityService().getCurrentUser();
|
||||
if (user != null) {
|
||||
JSONObject root = new JSONObject();
|
||||
JSONArray groups = new JSONArray();
|
||||
root.put("groupsUserIsPartOf", groups);
|
||||
for (UserGroup group : user.getUserGroups()) {
|
||||
JSONObject groupJson = new JSONObject();
|
||||
groupJson.put("uuid", group.getId().toString());
|
||||
groupJson.put("name", group.getName());
|
||||
groups.add(groupJson);
|
||||
}
|
||||
response = Response.ok(root.toJSONString()).build();
|
||||
} else {
|
||||
response = Response.status(401).build();
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link href='../../../../sailing-fontface-1.0.cache.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link href='../../../main.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link rel='icon' href='../../../../sap.ico' type='image/x-icon'>
|
||||
<title>SAP Sailing Analytics Webservices API Version 1.0</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>SAP Sailing Analytics Webservices API Version 1.0</h1>
|
||||
<h2>URL: /api/v1/events/{event-id}/migrate</h2>
|
||||
|
||||
<b>Description:</b>
|
||||
<p>Migrates the given object to a new owner, it will also attempt to update the related structure of other domain objects, to ensure a consistent result</p>
|
||||
<br/>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Webservice Type:</td>
|
||||
<td>PUT</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Output format:</td>
|
||||
<td>empty</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mandatory parameters:</td>
|
||||
<td>migrateCompetitors should the competitors be migrated as well</td>
|
||||
<td>migrateBoats should the boats be migrated as well</td>
|
||||
<td>createNewGroup determines if the migration will happen into a group that will be created (also required for currently unowned objects)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Optional parameters:</td>
|
||||
<td>existingGroupId group that should be changed, required for createNewGroup = false</td>
|
||||
<td>newGroupName name of the new group, required for createNewGroup = true</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Request method:</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Example:</td>
|
||||
<td>curl -X POST -H "Authorization: Bearer w9YSIfr/Zf6a127SZDddkhdAtQuuv0Jm1PSXlo1Yvd0=" "http://127.0.0.1:8888/sailingserver/api/v1/events/123456789-2975-42c8-a31b-365d0bca6197/migrate?existingGroupId=4bc6747a-2975-42c8-a31b-365d0bca6197&createNewGroup=false&migrateCompetitors=false&migrateBoats=false"<br>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="height: 1em;"></div>
|
||||
<a href="index.html">Back to Web Service Overview</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -37,9 +37,13 @@ name to make sure you get to the event you're interested in.
|
||||
<td>Creates a new event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="eventUpdate].html">/api/v1/events/{event-id}/update</a></td>
|
||||
<td><a href="eventUpdate.html">/api/v1/events/{event-id}/update</a></td>
|
||||
<td>Updates an existing event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="eventMigrate.html">/api/v1/events/{event-id}/migrate</a></td>
|
||||
<td>Migrates an existing event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="eventGetDoc.html">/api/v1/events</a></td>
|
||||
<td>Gets all events</td>
|
||||
@@ -165,6 +169,10 @@ name to make sure you get to the event you're interested in.
|
||||
<td><a href="leaderboardgroupGetDoc.html">/api/v1/leaderboardgroups/{name}</a></td>
|
||||
<td>Gets the details of a group of leaderboards</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="leaderboardGroupMigrate.html">/api/v1/leaderboardgroups/{name}/migrate</a></td>
|
||||
<td>Migrates an existing leaderboardGroup</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="leaderboardsGetDoc.html">/api/v1/leaderboards</a></td>
|
||||
<td>Gets all leaderboards</td>
|
||||
@@ -220,6 +228,10 @@ name to make sure you get to the event you're interested in.
|
||||
<tr>
|
||||
<td><a href="leaderboardRaceEnableRaceLogForCompetitorRegistration.html">/api/v1/leaderboards/{name}/leaderboardRaceEnableRaceLogForCompetitorRegistration</a></td>
|
||||
<td>Enables racelog useage for competitor registration</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="leaderboardMigrate.html">/api/v1/leaderboards/{name}/migrate</a></td>
|
||||
<td>Migrates an existing leaderboard</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="leaderboardMarkGpsFixesPostDoc.html">/api/v1/leaderboards/{name}/marks/{id}/gps_fixes</a></td>
|
||||
@@ -308,6 +320,10 @@ name to make sure you get to the event you're interested in.
|
||||
<td><a href="preferencesDelete.html">/api/v1/preferences/{SETTINGS_KEY}</a></td>
|
||||
<td>Removes a document from the preferences of a user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="usergroupsGet.html">/api/v1/usergroups/</a></td>
|
||||
<td>Lists all usergroups and their id's the current user is part of, required to obtain id's for migration for example</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="height: 1em;"></div>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link href='../../../../sailing-fontface-1.0.cache.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link href='../../../main.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link rel='icon' href='../../../../sap.ico' type='image/x-icon'>
|
||||
<title>SAP Sailing Analytics Webservices API Version 1.0</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>SAP Sailing Analytics Webservices API Version 1.0</h1>
|
||||
<h2>URL: /api/v1/leaderboardgroups/{name}/migrate</h2>
|
||||
|
||||
<b>Description:</b>
|
||||
<p>Migrates the given object to a new owner, it will also attempt to update the related structure of other domain objects, to ensure a consistent result</p>
|
||||
<br/>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Webservice Type:</td>
|
||||
<td>PUT</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Output format:</td>
|
||||
<td>empty</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mandatory parameters:</td>
|
||||
<td>migrateCompetitors should the competitors be migrated as well</td>
|
||||
<td>migrateBoats should the boats be migrated as well</td>
|
||||
<td>createNewGroup determines if the migration will happen into a group that will be created (also required for currently unowned objects)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Optional parameters:</td>
|
||||
<td>existingGroupId group that should be changed, required for createNewGroup = false</td>
|
||||
<td>newGroupName name of the new group, required for createNewGroup = true</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Request method:</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Example:</td>
|
||||
<td>curl -X POST -H "Authorization: Bearer w9YSIfr/Zf6a127SZDddkhdAtQuuv0Jm1PSXlo1Yvd0=" "http://127.0.0.1:8888/sailingserver/api/v1/leaderboardgroups/Extreme Sailing Series 2016/migrate?existingGroupId=4bc6747a-2975-42c8-a31b-365d0bca6197&createNewGroup=false&migrateCompetitors=false&migrateBoats=false"<br>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="height: 1em;"></div>
|
||||
<a href="index.html">Back to Web Service Overview</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link href='../../../../sailing-fontface-1.0.cache.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link href='../../../main.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link rel='icon' href='../../../../sap.ico' type='image/x-icon'>
|
||||
<title>SAP Sailing Analytics Webservices API Version 1.0</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>SAP Sailing Analytics Webservices API Version 1.0</h1>
|
||||
<h2>URL: /api/v2/leaderboard/{name}/migrate</h2>
|
||||
|
||||
<b>Description:</b>
|
||||
<p>Migrates the given object to a new owner, it will also attempt to update the related structure of other domain objects, to ensure a consistent result</p>
|
||||
<br/>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Webservice Type:</td>
|
||||
<td>PUT</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Output format:</td>
|
||||
<td>empty</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mandatory parameters:</td>
|
||||
<td>migrateCompetitors should the competitors be migrated as well</td>
|
||||
<td>migrateBoats should the boats be migrated as well</td>
|
||||
<td>createNewGroup determines if the migration will happen into a group that will be created (also required for currently unowned objects)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Optional parameters:</td>
|
||||
<td>existingGroupId group that should be changed, required for createNewGroup = false</td>
|
||||
<td>newGroupName name of the new group, required for createNewGroup = true</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Request method:</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Example:</td>
|
||||
<td>curl -X POST -H "Authorization: Bearer w9YSIfr/Zf6a127SZDddkhdAtQuuv0Jm1PSXlo1Yvd0=" "http://127.0.0.1:8888/sailingserver/api/v1/leaderboard/Extreme Sailing Series 2016 Cardiff/migrate?existingGroupId=4bc6747a-2975-42c8-a31b-365d0bca6197&createNewGroup=false&migrateCompetitors=false&migrateBoats=false"<br>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="height: 1em;"></div>
|
||||
<a href="index.html">Back to Web Service Overview</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link href='../../../../sailing-fontface-1.0.cache.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link href='../../../main.css' media='screen' rel='stylesheet' title='Default stylesheet' type='text/css' />
|
||||
<link rel='icon' href='../../../../sap.ico' type='image/x-icon'>
|
||||
<title>SAP Sailing Analytics Webservices API Version 1.0</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>SAP Sailing Analytics Webservices API Version 1.0</h1>
|
||||
<h2>URL: /api/v1/usergroups/</h2>
|
||||
|
||||
<b>Description:</b>
|
||||
<p>Gets the usergroup names and id's the currently logged in user is part of</p>
|
||||
<br/>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Webservice Type:</td>
|
||||
<td>REST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Output format:</td>
|
||||
<td>Json</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mandatory parameters:</td>
|
||||
<td>none</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Examples:</td>
|
||||
<td>
|
||||
Get @ http://sapsailing.com/sailingserver/api/v1/usergroups/
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="height: 1em;"></div>
|
||||
<a href="index.html">Back to Web Service Overview</a>
|
||||
</body>
|
||||
</html>
|
||||
+3
@@ -46,6 +46,7 @@ import com.sap.sailing.domain.tracking.TrackedRegatta;
|
||||
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
|
||||
import com.sap.sailing.server.impl.RacingEventServiceImpl;
|
||||
import com.sap.sailing.server.operationaltransformation.CreateFlexibleLeaderboard;
|
||||
import com.sap.sailing.server.operationaltransformation.RemoveAndUntrackRace;
|
||||
import com.sap.sailing.server.operationaltransformation.RemoveEvent;
|
||||
import com.sap.sailing.server.operationaltransformation.RemoveLeaderboard;
|
||||
import com.sap.sailing.server.operationaltransformation.RemoveLeaderboardGroup;
|
||||
@@ -119,6 +120,8 @@ public class RemoveLeaderboardTest {
|
||||
public void testRaceLogOfRaceColumnInSeriesDetachedWhenRegattaIsRemoved() {
|
||||
regatta.getRaceColumnByName(R1).setTrackedRace(defaultFleet, trackedRace);
|
||||
assertEquals(1, Util.size(trackedRace.getAttachedRaceLogs()));
|
||||
// removal of races is no longer done automatically, due to restrictions based on permission-vertical
|
||||
server.apply(new RemoveAndUntrackRace(trackedRace.getRaceIdentifier()));
|
||||
server.apply(new RemoveRegatta(new RegattaName(regatta.getName())));
|
||||
assertTrue(Util.isEmpty(trackedRace.getAttachedRaceLogs()));
|
||||
}
|
||||
|
||||
+5
@@ -11,6 +11,7 @@ import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
|
||||
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.security.SecurityService;
|
||||
@@ -113,6 +114,10 @@ public class SailingHierarchyOwnershipUpdater {
|
||||
|
||||
public void updateGroupOwnershipForLeaderboardHierarchy(Leaderboard leaderboard) {
|
||||
updateGroupOwner(leaderboard.getIdentifier());
|
||||
if (leaderboard instanceof RegattaLeaderboard) {
|
||||
RegattaLeaderboard regattaLeaderboard = (RegattaLeaderboard) leaderboard;
|
||||
updateGroupOwner(regattaLeaderboard.getRegatta().getIdentifier());
|
||||
}
|
||||
SailingHierarchyWalker.walkFromLeaderboard(leaderboard, new LeaderboardHierarchyVisitor() {
|
||||
@Override
|
||||
public void visit(TrackedRace race) {
|
||||
|
||||
+4
-4
@@ -98,7 +98,7 @@ public class AdminConsolePanel extends HeaderPanel implements HandleTabSelectabl
|
||||
|
||||
/**
|
||||
* If {@code null}, any permission will be accepted by
|
||||
* {@link #remeberWidgetLocationAndPermissions(VerticalOrHorizontalTabLayoutPanel, Widget, String, HasPermissions...)}
|
||||
* {@link #rememberWidgetLocationAndPermissions(VerticalOrHorizontalTabLayoutPanel, Widget, String, HasPermissions...)}
|
||||
* which is used by all methods that add a panel and optionally specify permissions required to see that panel.
|
||||
* If this field holds a valid permission collection, only permissions from this collection will be accepted.
|
||||
* This can be used to keep a central repository of all such permissions which in turn may be used to
|
||||
@@ -278,7 +278,7 @@ public class AdminConsolePanel extends HeaderPanel implements HandleTabSelectabl
|
||||
AbstractEntryPoint.setTabPanelSize(newTabPanel, "100%", "100%");
|
||||
newTabPanel.addSelectionHandler(tabSelectionHandler);
|
||||
newTabPanel.ensureDebugId(tabDebugId);
|
||||
remeberWidgetLocationAndPermissions(topLevelTabPanelWrapper, newTabPanel, tabTitle, requiresAnyOfThesePermissions);
|
||||
rememberWidgetLocationAndPermissions(topLevelTabPanelWrapper, newTabPanel, tabTitle, requiresAnyOfThesePermissions);
|
||||
return newTabPanel;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ public class AdminConsolePanel extends HeaderPanel implements HandleTabSelectabl
|
||||
* method can be called.
|
||||
*/
|
||||
private void addToTabPanel(VerticalOrHorizontalTabLayoutPanel tabPanel, RefreshableAdminConsolePanel panelToAdd, String tabTitle, WildcardPermission... requiresAnyOfThesePermissions) {
|
||||
remeberWidgetLocationAndPermissions(tabPanel, wrapInScrollPanel(panelToAdd.getWidget()), tabTitle, requiresAnyOfThesePermissions);
|
||||
rememberWidgetLocationAndPermissions(tabPanel, wrapInScrollPanel(panelToAdd.getWidget()), tabTitle, requiresAnyOfThesePermissions);
|
||||
panelsByWidget.put(panelToAdd.getWidget(), panelToAdd);
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ public class AdminConsolePanel extends HeaderPanel implements HandleTabSelectabl
|
||||
* widget. Otherwise, if any of these permissions implies any of the permissions the user has, the user
|
||||
* will be shown the widget.
|
||||
*/
|
||||
private void remeberWidgetLocationAndPermissions(VerticalOrHorizontalTabLayoutPanel tabPanel, Widget widgetToAdd,
|
||||
private void rememberWidgetLocationAndPermissions(VerticalOrHorizontalTabLayoutPanel tabPanel, Widget widgetToAdd,
|
||||
String tabTitle, WildcardPermission... requiresAnyOfThesePermissions) {
|
||||
if (acceptablePermissionsRequiredToSeeWidgets != null) {
|
||||
for (final WildcardPermission requiredPermission : requiresAnyOfThesePermissions) {
|
||||
|
||||
Reference in new issue
Block a user