bug4811: added new bundle com.sap.sse.landscape.common

This commit is contained in:
Axel Uhl
2021-01-14 13:41:28 +01:00
parent c0aed54cbc
commit eb2edbb9d1
42 changed files with 489 additions and 337 deletions
@@ -8,4 +8,3 @@ Automatic-Module-Name: com.sap.sailing.landscape.common
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.sap.sse.security.common,
com.sap.sse.common
Export-Package: com.sap.sailing.landscape.common
@@ -1,50 +0,0 @@
package com.sap.sailing.landscape.common;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.sap.sse.security.shared.HasPermissions;
import com.sap.sse.security.shared.impl.HasPermissionsImpl;
import com.sap.sse.security.shared.impl.SecuredSecurityTypes;
/**
* The basic types of logical objects provided by the landscape bundle that themselves have permissions governing how
* users may deal with them.
*
* @author Axel Uhl (d043530)
*
*/
public class SecuredLandscapeTypes extends HasPermissionsImpl {
private static final long serialVersionUID = -5052828472297142038L;
private static Set<HasPermissions> allInstances = new HashSet<>();
public SecuredLandscapeTypes(String logicalTypeName, Action... availableActions) {
super(logicalTypeName, availableActions);
allInstances.add(this);
}
public SecuredLandscapeTypes(String logicalTypeName) {
super(logicalTypeName);
allInstances.add(this);
}
public static Iterable<HasPermissions> getAllInstances() {
return Collections.unmodifiableSet(allInstances);
}
/**
* The type-relative identifier consists of the region ID and the key name.
*/
public static final HasPermissions SSH_KEY = new SecuredLandscapeTypes("SSH_KEY");
public static enum LandscapeActions implements Action {
MANAGE;
private static final Action[] ALL_ACTIONS = new Action[] { MANAGE,
DefaultActions.CHANGE_OWNERSHIP, DefaultActions.CHANGE_ACL };
}
public static final HasPermissions LANDSCAPE = new SecuredSecurityTypes("LANDSCAPE", LandscapeActions.ALL_ACTIONS);
}