adjusted legal info, new filter features
diff --git a/org.eclipse.osbp.ui.api.feature/feature.xml b/org.eclipse.osbp.ui.api.feature/feature.xml
index fc18dd1..97a18b7 100644
--- a/org.eclipse.osbp.ui.api.feature/feature.xml
+++ b/org.eclipse.osbp.ui.api.feature/feature.xml
@@ -17,7 +17,7 @@
label="%featureName"
version="0.9.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.osbp.ui.api">
+ plugin="org.eclipse.osbp.license">
<description>
%description
diff --git a/org.eclipse.osbp.ui.api/META-INF/MANIFEST.MF b/org.eclipse.osbp.ui.api/META-INF/MANIFEST.MF
index 0baa7f7..e1c704a 100644
--- a/org.eclipse.osbp.ui.api/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ui.api/META-INF/MANIFEST.MF
@@ -7,7 +7,8 @@
com.vaadin.server;bundle-version="7.7.6",
org.eclipse.osbp.runtime.common,
org.eclipse.e4.ui.model.workbench,
- org.eclipse.e4.core.contexts
+ org.eclipse.e4.core.contexts,
+ org.eclipse.xtext.common.types
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.osbp.ui.api.complexdatacontainer;version="0.9.0",
org.eclipse.osbp.ui.api.contextfunction;version="0.9.0";uses:="com.vaadin.ui",
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java
index 36ff1cc..1a59eec 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java
@@ -23,8 +23,6 @@
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherDataTag;
import org.eclipse.osbp.runtime.common.event.IDualData;
-import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
-import org.eclipse.osbp.ui.api.user.IUser;
/**
* The Class DatamartFilter.
@@ -34,38 +32,32 @@
/** The Constant FILTER_PLACEHOLDER. */
public static final String FILTER_PLACEHOLDER = "#";
- /**
- * The Enum FilterType.
- */
- public enum FilterType {
-
+ public enum MultipleType {
+ /** no combo, no list */
+ NONE,
/** single selection via combobox. */
SINGLE,
/** multiple selection via listbox. */
- MULTIPLE,
+ MULTIPLE
+ }
+
+ /**
+ * The Enum FilterType.
+ */
+ public enum FilterType {
+ /** The sql condition. */
+ SQL,
/** cube condition except for something. */
EXCEPT,
- /** slice a single value. */
- SINGLESLICER,
+ /** slice value(s). */
+ SLICER,
- /** slice multiple values. */
- MULTIPLESLICER,
-
- /** hierarchy with single value. */
- SINGLEHIERARCHY,
-
- /** hierarchy with multiple values. */
- MULTIPLEHIERARCHY,
+ /** hierarchy. */
+ HIERARCHY,
- /** hierarchy children with single value. */
- SINGLEHIERARCHYCHILDREN,
-
- /** hierarchy children with multiple values. */
- MULTIPLEHIERARCHYCHILDREN,
-
/** range of two values. */
BETWEEN,
@@ -73,7 +65,10 @@
BETWEEN_DATE,
/** select by id. */
- BY_ID
+ BY_ID,
+
+ /** select by histuuid. */
+ BY_HISTUUID
}
/**
@@ -209,7 +204,10 @@
/** The short name. No aliased name even if it exists.*/
private String shortName;
- /** The type. */
+ /** The sel type. */
+ private MultipleType multipleType;
+
+ /** The type. */
private FilterType type;
/** The sql command to fill data. */
@@ -235,35 +233,32 @@
public DateTimeFormat format;
public DateResolution resolution;
-
- private IDSLMetadataService dslMetadataService;
-
- private IUser user;
/**
* Instantiates a new datamart filter for non date data typed attributes.
*
+ * @param multiple the multiple
* @param type the type
- * @param dateFormatMap
* @param name the name
* @param sql the sql
+ * @param optional the optional
*/
- public DatamartFilter(IDSLMetadataService dslMetadataService, IUser user, FilterType type, String name, String sql, boolean optional) {
- this( dslMetadataService, user, type, name, "", sql, optional);
+ public DatamartFilter(MultipleType multiple, FilterType type, String name, String sql, boolean optional) {
+ this(multiple, type, name, "", sql, optional);
}
/**
* Instantiates a new datamart filter for non date data typed attributes.
*
+ * @param multiple the multiple
* @param type the type
- * @param dateFormatMap
* @param name the name
* @param shortName the short name
* @param sql the sql
+ * @param optional the optional
*/
- public DatamartFilter(IDSLMetadataService dslMetadataService, IUser user, FilterType type, String name, String shortName, String sql, boolean optional) {
- this.dslMetadataService = dslMetadataService;
- this.user = user;
+ public DatamartFilter(MultipleType multiple, FilterType type, String name, String shortName, String sql, boolean optional) {
+ this.multipleType = multiple;
this.type = type;
this.name = name;
this.shortName = shortName;
@@ -276,27 +271,30 @@
/**
* Instantiates a new datamart filter for date data typed attributes.
*
+ * @param multiple the multiple
* @param type the type
- * @param dateFormatMap
+ * @param dateFormatMap the date format map
* @param name the name
- * @param shortName the short name
* @param sql the sql
+ * @param optional the optional
*/
- public DatamartFilter(IDSLMetadataService dslMetadataService, IUser user, FilterType type, Map<String, String> dateFormatMap, String name, String sql, boolean optional) {
- this(dslMetadataService, user, type, dateFormatMap, name, "", sql, optional);
+ public DatamartFilter(MultipleType multiple, FilterType type, Map<String, String> dateFormatMap, String name, String sql, boolean optional) {
+ this(multiple, type, dateFormatMap, name, "", sql, optional);
}
/**
* Instantiates a new datamart filter for date data typed attributes.
*
+ * @param multiple the multiple
* @param type the type
- * @param dateFormatMap
+ * @param dateFormatMap the date format map
* @param name the name
+ * @param shortName the short name
* @param sql the sql
+ * @param optional the optional
*/
- public DatamartFilter(IDSLMetadataService dslMetadataService, IUser user, FilterType type, Map<String, String> dateFormatMap, String name, String shortName, String sql, boolean optional) {
- this.dslMetadataService = dslMetadataService;
- this.user = user;
+ public DatamartFilter(MultipleType multiple, FilterType type, Map<String, String> dateFormatMap, String name, String shortName, String sql, boolean optional) {
+ this.multipleType = multiple;
this.type = type;
this.name = name;
this.shortName = shortName;
@@ -393,6 +391,24 @@
this.type = type;
}
+ /**
+ * Gets the multiple type.
+ *
+ * @return the multiple type
+ */
+ public MultipleType getMultipleType() {
+ return multipleType;
+ }
+
+ /**
+ * Sets the multiple type.
+ *
+ * @param multipleType the new multiple type
+ */
+ public void setMultipleType(MultipleType multipleType) {
+ this.multipleType = multipleType;
+ }
+
/**
* Gets the sql.
*
@@ -428,6 +444,10 @@
public void setCondition(String condition) {
this.condition = condition;
}
+
+ public String getHistCondition(String currentColumnName) {
+ return currentColumnName+"=1";
+ }
/**
* Gets the selector.
@@ -638,12 +658,10 @@
* Can select data. Returns true if a filter matched the given selected data and selects the selector.
*
* @param selectedData the selected data
- * @param single the single
- * @param olap the olap
* @return true, if successful
*/
@SuppressWarnings("unchecked")
- public boolean canSelectData(Map<EventDispatcherDataTag, Object> selectedData, boolean single, boolean olap) {
+ public boolean canSelectData(Map<EventDispatcherDataTag, Object> selectedData) {
for(EventDispatcherDataTag tag : selectedData.keySet()) {
if(tag == EventDispatcherDataTag.ID) {
return false;
@@ -658,13 +676,12 @@
* Select data.
*
* @param selected the selected
- * @param olap the olap
* @return true, if successful
*/
private boolean selectData(List<String> selected) {
boolean firstAdd = true;
for(String item:selected) {
- switch(type) {
+ switch(multipleType) {
case SINGLE:
case MULTIPLE:
for(IDualData dd : data) {
@@ -678,13 +695,14 @@
}
}
break;
+ default:
+ break;
+ }
+
+ switch(type) {
case EXCEPT:
- case SINGLESLICER:
- case MULTIPLESLICER:
- case SINGLEHIERARCHY:
- case MULTIPLEHIERARCHY:
- case SINGLEHIERARCHYCHILDREN:
- case MULTIPLEHIERARCHYCHILDREN:
+ case SLICER:
+ case HIERARCHY:
if(!item.contains("[") && !data.isEmpty()) {
String prefix = data.get(0).getHierarchyWithBrackets()+".";
String suffix = ".["+item.replace(".", "].[")+"]";
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartPrimary.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartPrimary.java
index 0d177ed..d6edb49 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartPrimary.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartPrimary.java
@@ -17,20 +17,17 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.osbp.dsl.semantic.entity.LEntity;
-import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute;
-
-public class DatamartPrimary<T> {
+public class DatamartPrimary {
private String alias;
private String attributeName;
private String entityName;
- private List<T> keys;
+ private List<Object> keys;
public DatamartPrimary(String alias, String attributeName, String entityName) {
this.attributeName = attributeName;
this.entityName = entityName;
this.alias = alias;
- keys = new ArrayList<T>();
+ keys = new ArrayList<Object>();
}
public String getAlias() {
return alias;
@@ -44,10 +41,13 @@
public void clear() {
keys.clear();
}
- public void add(T id) {
+ public void add(Object id) {
keys.add(id);
}
- public boolean contains(T id) {
+ public boolean contains(Object id) {
return keys.contains(id);
}
+ public List<Object> getKeys() {
+ return keys;
+ }
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java
index c95211f..74cfd7a 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java
@@ -15,14 +15,13 @@
package org.eclipse.osbp.ui.api.datamart;
import java.util.ArrayList;
-import java.util.List;
import java.util.Map;
import org.eclipse.osbp.ui.api.user.IUser;
public interface IDataMart {
public enum EType {
- BOOLEAN, BOOLEAN_CHECKBOX, DATE, TIME, TIMESTAMP, FLOAT, DOUBLE, BYTE, SHORT, INTEGER, LONG, STRING, RICHTEXTAREA, BLOPMAPPING, LENUM, NONE
+ BOOLEAN, BOOLEAN_CHECKBOX, DATE, TIME, TIMESTAMP, FLOAT, DOUBLE, BYTE, SHORT, INTEGER, LONG, STRING, RICHTEXTAREA, BLOPMAPPING, LENUM, HISTUUID, NONE
}
public enum AttributeVisibility {
HIDDEN, READONLY
@@ -33,6 +32,10 @@
static final String DATAMART_CONTAINER_POSTFIX = "DatamartContainer";
static final String DATAMART_ID_COLUMN_PREFIX = "__";
static final String DATAMART_ID_COLUMN_POSTFIX = "__ID__";
+ static final String DATAMART_VALID_COLUMN_PREFIX = "__";
+ static final String DATAMART_VALID_COLUMN_POSTFIX = "__VALIDFROM__";
+ static final String DATAMART_CURRENT_COLUMN_PREFIX = "__";
+ static final String DATAMART_CURRENT_COLUMN_POSTFIX = "__CURRENT__";
static final String SQLFILTERNOTHING = "'*'";
void setUser(IUser user);
IUser getUser();
@@ -43,9 +46,10 @@
Map<String, EType> getTypesMap();
Map<String, String> getTypesProp();
Map<String, AttributeVisibility> getHiddenMap();
- List<DatamartPrimary<?>> getPrimaryList();
+ Map<String, DatamartPrimary> getPrimaryList();
void computeConditions();
void clearCache();
String getResultAttribute(String attributeName);
String getPrimaryFilterId();
+ boolean contains(final Object key);
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java
index cf45e10..f10582c 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java
@@ -26,13 +26,6 @@
public interface IDatamartSelectable {
/**
- * Checks if is slicer.
- *
- * @return true, if is slicer
- */
- boolean isSlicer();
-
- /**
* Checks if is multi selected.
*
* @return true, if is multi selected
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/layout/IViewLayoutManager.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/layout/IViewLayoutManager.java
index 6132105..fe89c32 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/layout/IViewLayoutManager.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/layout/IViewLayoutManager.java
@@ -21,10 +21,12 @@
public interface IViewLayoutManager {
void init(AbstractOrderedLayout parent);
+ void init(AbstractOrderedLayout parent, String styleName, String imagePath);
void addExtension(Extension extension);
void removeExtension(Extension extension);
void setLabelValue(String text);
HorizontalLayout getTopArea();
VerticalLayout getSideArea();
VerticalLayout getDataArea();
+ String getCaption();
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java
index ecf7165..f39b378 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java
@@ -22,6 +22,8 @@
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.osbp.dsl.xtext.types.bundles.BundleSpaceTypeProvider;
+import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
+import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.resource.IEObjectDescription;
import org.eclipse.xtext.util.Pair;
@@ -290,4 +292,49 @@
* @param extension the extension
*/
void unloadModel(String extension);
+
+ /**
+ * Checks if the given perspective elements are authorized.
+ *
+ * @param fqn the fully qualified model element id
+ * @param userAccessService the user access service
+ * @return true, if perspective is authorized
+ */
+ boolean isPerspectiveAuthorized(String fqn, IUserAccessService userAccessService);
+
+ /**
+ * Checks if a perspective element is authorized.
+ *
+ * @param modelElement the model element
+ * @param userAccessService the user access service
+ * @return true, if is perspective element authorized
+ */
+ boolean isPerspectiveElementAuthorized(EObject modelElement, IUserAccessService userAccessService);
+
+ /**
+ * Checks if a menu category is authorized.
+ *
+ * @param fqn the fully qualified model element id
+ * @param userAccessService the user access service
+ * @return true, if menu category is authorized
+ */
+ boolean isMenuCategoryAuthorized(String fqn, IUserAccessService userAccessService);
+
+ /**
+ * Checks if menu tree is authorized.
+ *
+ * @param fqn the fully qualified model element id
+ * @param userAccessService the user access service
+ * @return true, if menu tree is authorized
+ */
+ boolean isMenuTreeAuthorized(String fqn, IUserAccessService userAccessService);
+
+ /**
+ * Checks an xtext typeReference for a given supertype.
+ *
+ * @param typeReference the type reference
+ * @param clz the clz
+ * @return true, if successful
+ */
+ boolean hasSupertype(JvmTypeReference typeReference, Class<?> clz);
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/perspective/IPerspectiveProvider.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/perspective/IPerspectiveProvider.java
index ad5161e..30480ab 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/perspective/IPerspectiveProvider.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/perspective/IPerspectiveProvider.java
@@ -16,6 +16,10 @@
package org.eclipse.osbp.ui.api.perspective;
public interface IPerspectiveProvider {
+
+ public static final String WELCOME_SCREEN_ID = "welcomeScreen";
+ public static final String TRANSIENT_DIALOG_MODEL = "dialogModel";
+ public static final String TRANSIENT_EMBEDDED_DIALOG_MODEL = "embeddedDialogModel";
public static final class PerspectiveViewType {
private PerspectiveViewType() {
@@ -124,4 +128,8 @@
* @param clazz the clazz
*/
void openPerspective(String elementId, String labelName, Class<?> clazz);
+
+ public static String toPerspectiveElementId(String perspectiveId){
+ return IPerspectiveProvider.E4Constants.PERSPECTIVE_PREFIX + perspectiveId;
+ }
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/IThemeResourceService.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/IThemeResourceService.java
index ea6ed34..a20e582 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/IThemeResourceService.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/IThemeResourceService.java
@@ -21,24 +21,34 @@
import com.vaadin.server.Resource;
+/**
+ * The Interface IThemeResourceService.
+ */
public interface IThemeResourceService {
/** The id. */
public static String ID = IThemeResourceService.class.getName();
- /** all available theme resource types */
+ /**
+ * all available theme resource types.
+ */
static public enum ThemeResourceType {
- /** any "big" images like background images */
+
+ /** any "big" images like background images. */
IMAGE,
- /** any "small" icons, mostly 16x16 px */
+
+ /** any "small" icons, mostly 16x16 px. */
ICON,
- /** flag icon, mostly 16x16 px */
+
+ /** flag icon, mostly 16x16 px. */
FLAG,
- /** html resource */
+
+ /** html resource. */
HTML,
/** sound resource. */
SOUND,
- /** video resource */
+
+ /** video resource. */
VIDEO
}
@@ -50,32 +60,51 @@
* @param themeManager the theme manager
*/
void init(IApplicationContext appContext, Object themeEngine, Object themeManager);
+
/**
- * Resets the base paths of the theme resource
+ * Resets the base paths of the theme resource.
*/
void reset();
+
/**
- * @param themeResourceType
+ * Gets the theme resource type extension.
+ *
+ * @param themeResourceType the theme resource type
* @return the file extension defined for the theme resource type
*/
String getThemeResourceTypeExtension(ThemeResourceType themeResourceType);
/**
- * @param themeResourceType
+ * Gets the theme resource type path.
+ *
+ * @param themeResourceType the theme resource type
* @return the path defined for the theme resource type
*/
String getThemeResourceTypePath(ThemeResourceType themeResourceType);
/**
- * @param resourceID
- * @param themeResourceType
+ * Gets the theme URI.
+ *
+ * @param resourceID the resource ID
+ * @param themeResourceType the theme resource type
* @return the full qualified uri for the resource id of the theme resource type
*/
String getThemeURI(String resourceID, ThemeResourceType themeResourceType);
/**
- * @param resourceID
- * @param themeResourceType
+ * Gets the theme relative path.
+ *
+ * @param resourceID the resource ID
+ * @param themeResourceType the theme resource type
+ * @return the theme relative path
+ */
+ String getThemeResourceRelativePath(String resourceID, ThemeResourceType themeResourceType);
+
+ /**
+ * Gets the theme resource.
+ *
+ * @param resourceID the resource ID
+ * @param themeResourceType the theme resource type
* @return the resource for the resource id of the theme resource type
*/
Resource getThemeResource(String resourceID, ThemeResourceType themeResourceType);
@@ -89,6 +118,15 @@
InputStream getThemeResourceInputStream(String resourceURL);
/**
+ * Gets the theme resource input stream.
+ *
+ * @param resourceID the resource ID
+ * @param themeResourceType the theme resource type
+ * @return the theme resource input stream
+ */
+ InputStream getThemeResourceInputStream(String resourceID, ThemeResourceType themeResourceType);
+
+ /**
* Gets the theme resource HTML. The resource must have TRANSLATABLE in its name to be translated.
*
* @param subject the subject
@@ -96,4 +134,11 @@
* @return the theme resource HTML
*/
String getThemeResourceHTML(String subject, Locale locale);
+
+ /**
+ * Gets the theme resource mxGraph path.
+ *
+ * @return the theme resource mxGraph path
+ */
+ String getThemeResourceMxGraphPath();
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractAuthorization.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractAuthorization.java
index 4b6e484..7911ac8 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractAuthorization.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractAuthorization.java
@@ -14,12 +14,10 @@
*/
package org.eclipse.osbp.ui.api.useraccess;
-import java.util.Collection;
+import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,10 +31,10 @@
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractAuthorization.class);
/** The role permissions. */
- private HashMap<String, List<Set<Permission>>> rolePermissions = new HashMap<>();
+ private Map<String, List<List<Permission>>> rolePermissions = new HashMap<>();
/** the fast lookup map */
- private HashMap<String, Action> fastPermissions = new HashMap<>();
+ private Map<String, Action> fastPermissions = new HashMap<>();
/**
* Adds the role permissions.
@@ -44,10 +42,10 @@
* @param roleName the role name
* @param permissions the permissions
*/
- public void addRolePermissions(String roleName, List<Set<Permission>> permissions) {
+ public void addRolePermissions(String roleName, List<List<Permission>> permissions) {
String key;
rolePermissions.put(roleName, permissions);
- for(Set<Permission> permissionSet : permissions) {
+ for(List<Permission> permissionSet : permissions) {
for(Permission permission:permissionSet) {
key = String.format("%s%s%s%s", roleName, permission.group, permission.clazz, permission.attribute);
fastPermissions.put(key, permission.action);
@@ -62,7 +60,7 @@
* the role
* @return the role authorization group
*/
- public final List<Set<Permission>> getRolePermissions(String role) {
+ public final List<List<Permission>> getRolePermissions(String role) {
return rolePermissions.get(role);
}
@@ -71,7 +69,7 @@
*
* @return the authorization groups
*/
- public final Map<String, List<Set<Permission>>> getAuthorizationGroups() {
+ public final Map<String, List<List<Permission>>> getAuthorizationGroups() {
return this.rolePermissions;
}
@@ -80,8 +78,9 @@
*
* @return the roles
*/
- public final Collection<String> getRoles() {
- return rolePermissions.keySet();
+ @SuppressWarnings("unchecked")
+ public final List<String> getRoles() {
+ return new ArrayList<String>(rolePermissions.keySet());
}
public boolean isApplicableGrant(Group group, Action action, String descriptor) {
@@ -97,58 +96,16 @@
return false;
}
-// public boolean isApplicableGrant(Group group, Action action, String descriptor) {
-// LOGGER.debug("isApplicableGrant group:{} action:{} descriptor:{}", group, action, descriptor);
-// for(String roleName : getRoles()) {
-// for(Set<Permission> permissionSet : getAuthorizationGroups().get(roleName)) {
-// for(Permission permission:permissionSet) {
-// LOGGER.trace("role:{} permission:{}", roleName, permission);
-// if(permission.clazz.equals(descriptor) && permission.group == group && permission.action.getWeight() >= action.getWeight()) {
-// LOGGER.debug("grant result {}", true);
-// return true;
-// }
-// }
-// }
-// }
-// LOGGER.debug("grant result {}", false);
-// return false;
-// }
-
public boolean isApplicableVeto(Group group, Action action, String descriptor, String property) {
for(String roleName : getRoles()) {
String key = String.format("%s%s%s%s", roleName, group, descriptor, property);
if(fastPermissions.containsKey(key)) {
Action a = fastPermissions.get(key);
- if (a.getWeight() < action.getWeight()) {
- return false;
- } else {
- return true;
- }
+ return a.getWeight() >= action.getWeight();
}
}
return false;
}
-// public boolean isApplicableVeto(Group group, Action action, String descriptor, String property) {
-// LOGGER.debug("isApplicableVeto group:{} action:{} descriptor:{} property:{}", group, action, descriptor, property);
-// for(String roleName : getRoles()) {
-// for(Set<Permission> permissionSet : getAuthorizationGroups().get(roleName)) {
-// for(Permission permission:permissionSet) {
-// LOGGER.trace("role:{} permission:{}", roleName, permission);
-// if(permission.clazz.equals(descriptor) && permission.attribute != null && permission.attribute.equals(property) && permission.group == group) {
-// if(permission.action.getWeight() < action.getWeight()) {
-// LOGGER.debug("veto result {}", false);
-// return false;
-// } else {
-// LOGGER.debug("veto result {}", true);
-// return true;
-// }
-// }
-// }
-// }
-// }
-// LOGGER.debug("veto result {}", false);
-// return true;
-// }
/**
* Granted.
@@ -158,8 +115,8 @@
* @param actions the actions
* @return the sets the
*/
- public static final Set<Permission> granted(Group group, String clas, Action... actions) {
- Set<Permission> granted = new HashSet<>();
+ public static final List<Permission> granted(Group group, String clas, Action... actions) {
+ List<Permission> granted = new ArrayList<>();
for (Action action : actions) {
granted.add(new Permission(group, clas, action));
}
@@ -175,8 +132,8 @@
* @param actions the actions
* @return the sets the
*/
- public static final Set<Permission> denied(Group group, String clas, String attribute, Action... actions) {
- Set<Permission> denied = new HashSet<>();
+ public static final List<Permission> denied(Group group, String clas, String attribute, Action... actions) {
+ List<Permission> denied = new ArrayList<>();
for (Action action : actions) {
denied.add(new Permission(group, clas, attribute, action));
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractPosition.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractPosition.java
index 1e106bc..dea76e0 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractPosition.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/AbstractPosition.java
@@ -14,10 +14,10 @@
*/
package org.eclipse.osbp.ui.api.useraccess;
-import java.util.Collection;
+import java.util.List;
/**
- * The Class APosition.
+ * The Class AbstractPosition.
*/
public abstract class AbstractPosition extends AbstractOrgElement implements IPosition {
@@ -31,7 +31,7 @@
*
* @return the roles
*/
- public Collection<String> getRoles() {
+ public List<String> getRoles() {
return authorization.getRoles();
}
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java
index 0f64651..bc728d5 100644
--- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java
+++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java
@@ -14,7 +14,7 @@
*/
package org.eclipse.osbp.ui.api.useraccess;
-import java.util.Collection;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -24,16 +24,23 @@
import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Group;
import org.eclipse.osbp.ui.api.userfilter.UserFilterMap;
-// TODO: Auto-generated Javadoc
/**
* The Interface IUserAccessService.
*/
public interface IUserAccessService extends IComplexDataContainer {
- public final String ADMINISTRATOR = "Administrator";
// in case we have no organizational information
public final String DEFAULTUSERROLE = "Users";
- public final String DEFAULTADMINROLE = "Admins";
+ public final String DEFAULTADMINROLE = "Administrators";
+ /** The Constant NAME_ADMINISTRATOR. */
+ static final String NAME_ADMINISTRATOR="Administrator";
+
+ /** The Constant PASSWORD_ADMINISTRATOR. */
+ static final String PASSWORD_ADMINISTRATOR="Administrator";
+
+ /** The Constant POS_ADMINISTRATOR. */
+ static final String POS_ADMINISTRATOR="Administrator";
+
/**
* Gets the authorizations.
@@ -117,7 +124,7 @@
*
* @return the roles
*/
- Collection<String> getRoles();
+ List<String> getRoles();
/**
* Gets the permissions.
@@ -293,7 +300,7 @@
* the username
* @return the collection
*/
- Collection<String> findRolesForUser(String username);
+ List<String> findRolesForUser(String username);
/**
* Find permissions for user.
@@ -418,7 +425,7 @@
*
* @return the all user account roles
*/
- Map<String, Collection<String>> getAllUserAccountRoles();
+ Map<String, List<String>> getAllUserAccountRoles();
/**
* Gets the locale tag.
@@ -469,6 +476,17 @@
*/
boolean isSuperuser();
+ /**
+ * Persist ui properties of the current user.
+ *
+ * @param properties the properties
+ */
void persistProperties(Map<String, Object> properties);
+ /**
+ * Gets the blip process permissions for the authenticating organization from preferences.
+ *
+ * @return the blip process permissions
+ */
+ IBlipProcessPermissions getBlipProcessPermissions();
}