mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 06:18:12 +00:00
Merge branch 'permission-vertical' of ssh://trac@sapsailing.com/home/trac/git into permission-vertical
This commit is contained in:
commit
ef4b5a37ac
3 files changed
+49
-8
No files matched your search
+22
-5
@@ -6,6 +6,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.http.client.UrlBuilder;
|
||||
import com.google.gwt.json.client.JSONArray;
|
||||
import com.google.gwt.json.client.JSONObject;
|
||||
import com.google.gwt.json.client.JSONParser;
|
||||
@@ -164,13 +165,29 @@ public class DataMiningEntryPoint extends AbstractSailingEntryPoint {
|
||||
}
|
||||
|
||||
private void removeUrlParameter() {
|
||||
String newUrl = Window.Location.createUrlBuilder().setHost(Window.Location.getHost())
|
||||
.setPort(Integer.parseInt(Window.Location.getPort())).setPath(Window.Location.getPath())
|
||||
.setProtocol(Window.Location.getProtocol()).buildString();
|
||||
newUrl = newUrl.replaceAll("\\?.*$", "");
|
||||
updateUrl(Window.getTitle(), newUrl);
|
||||
try {
|
||||
UrlBuilder builder = Window.Location.createUrlBuilder().setHost(Window.Location.getHost())
|
||||
.setPath(Window.Location.getPath()).setProtocol(Window.Location.getProtocol());
|
||||
|
||||
String port = Window.Location.getPort();
|
||||
if (port != null && !"".equals(port.trim()) && !"0".equals(port)) {
|
||||
builder.setPort(Integer.parseInt(port));
|
||||
}
|
||||
String newUrl = builder.buildString();
|
||||
newUrl = newUrl.replaceAll("\\?.*$", "");
|
||||
|
||||
updateUrl(Window.getTitle(), newUrl);
|
||||
} catch (Exception e) {
|
||||
LOG.severe("Could not update URL: " + e.getMessage());
|
||||
// In the worst case, the URL is not updated. This should not impact the user experience of
|
||||
// data mining.
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* using JSNI because GWT-History-Mapper does currently not support updating an URL in the history without reloading
|
||||
* the page
|
||||
*/
|
||||
private native void updateUrl(String title, String newUrl)/*-{
|
||||
$wnd.history.replaceState(null, title, newUrl);
|
||||
}-*/;
|
||||
|
||||
+10
-1
@@ -13,6 +13,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CompetitorWithBoat;
|
||||
import com.sap.sailing.domain.base.CourseArea;
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
@@ -83,7 +84,15 @@ public class RegattaByKeywordSearchService {
|
||||
leaderboardStrings.add(leaderboard.getDisplayName());
|
||||
for (Competitor competitor : leaderboard.getCompetitors()) {
|
||||
leaderboardStrings.add(competitor.getName());
|
||||
leaderboardStrings.add(competitor.getShortName());
|
||||
if (competitor.getShortName() != null) {
|
||||
leaderboardStrings.add(competitor.getShortName());
|
||||
}
|
||||
if (competitor.getSearchTag() != null) {
|
||||
leaderboardStrings.add(competitor.getSearchTag());
|
||||
}
|
||||
if (competitor.hasBoat() && ((CompetitorWithBoat) competitor).getBoat().getSailID() != null) {
|
||||
leaderboardStrings.add(((CompetitorWithBoat) competitor).getBoat().getSailID());
|
||||
}
|
||||
String competitorDisplayName = leaderboard.getDisplayName(competitor);
|
||||
if (competitorDisplayName != null) {
|
||||
leaderboardStrings.add(competitorDisplayName);
|
||||
|
||||
@@ -118,10 +118,25 @@ Tenant ownership has implications only for the application of roles that are qua
|
||||
|
||||
### Implementation of Sharing Data Objects with Public
|
||||
|
||||
In general, sharing a data object with the public should just be granting the “view” permission to everyone. This in return allows everybody that knows the link where one can view the data object to view it.
|
||||
In general, sharing a data object with the public should just be granting the “view” permission to everyone. For this purpose, the ``<ALL>`` user can be assigned the corresponding ``READ`` permission. This in return allows everybody that knows the link where one can view the data object to view it.
|
||||
|
||||
Alternatively, an access control list (ACL) could be assigned to the object, using a ``null`` group assignment, thereby making this ACL applicable to all users, regardless of their group memberships. The ACL will also be checked for permission requests by not authenticated users.
|
||||
|
||||
The remaining challenge is the application of the permissions necessary for *all* objects in the *scope* that is to be shared. A user it typically not interested in sharing only the bare *Event* object but would rather want to grant public access to everything *belonging to* the event, including all leaderboard groups, leaderboards, regattas and tracked races.
|
||||
|
||||
The problem with this is that this object set is dynamic. It changes as users add object to or remove them from the scope of the event. For example, if another race is being added after the event has been shared, a reasonable behavior seems to be that the new race shall also be shared together with everything else belonging to the overarching event that has been shared before. This is similar to a "setgid" bit in a Unix file system.
|
||||
|
||||
For this to work we will need observable object relationships which can trigger rules for permission propagation along the relationships. While we agreed that the permission checking mechanism must not need to analyze object relationships, changes in relationships may lead to updates in permissions.
|
||||
|
||||
Examples: when a user links a leaderboard group to an event that is visible to a larger set of users than the leaderboard group, the user may receive a hint suggesting to update the leaderboard group's permissions to match those of the event into which it is just being linked. Similarly, if a leaderboard is added to a leaderboard group, the user may want to propagate the leaderboard group's visibility to that of the leaderboard just added to the group.
|
||||
|
||||
Possible approach: make directed permission propagation a property on associations between domain types that users can configure. Such associations then need to be observed by the permission propagation mechanism, and when links are added (what if they are removed?) the permission propagation is triggered. Furthermore, permission propagation may need to be triggered when the permissions on a source object of a permission propagation change, in order to support transitive permission propagation, e.g., when a LeaderboardGroup is added to an Event, so that also all Leaderboards and Regattas and TrackedRaces reachable from that LeaderboardGroup receive the same permission update as the LeaderboardGroup itself.
|
||||
|
||||
Propagation rule candidates: Event---LeaderboardGroup; LeaderboardGroup---Leaderboard; Leaderboard---Regatta; Leaderboard---TrackedRace.
|
||||
|
||||
This is separated from promoting this public data object (e.g. event) on the official SAP site. This would have to be a separate list which can be edited by e.g. media admins. This would however only link to the source, because otherwise all promoted material would have to be imported to the archive.
|
||||
|
||||
The ACL will also be checked for permission requests by not authenticated users. This will only apply to ACL entries that are valid for all users.
|
||||
|
||||
|
||||
## Permissions in Frontend
|
||||
|
||||
|
||||
Reference in new issue
Block a user