com.wewebu.ow.server.ecmimpl.owdummy
Class OwDummyRoleManager

java.lang.Object
  extended by com.wewebu.ow.server.role.OwStandardRoleManager
      extended by com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
          extended by com.wewebu.ow.server.ecmimpl.owdummy.OwDummyRoleManager
All Implemented Interfaces:
com.wewebu.ow.server.role.OwRoleManager

public class OwDummyRoleManager
extends com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager

Dummy implementation for the RoleManager.
Used to simulate some roles / master roles.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.role.OwStandardRoleManager
com.wewebu.ow.server.role.OwStandardRoleManager.CategoryNames, com.wewebu.ow.server.role.OwStandardRoleManager.StandardFunctionResources
 
Field Summary
 
Fields inherited from class com.wewebu.ow.server.role.OwStandardRoleManager
APPLICATION_PREFIX_DELIMITER, m_AllowedPluginTypesMap, m_ConfigNode, m_DefaultMimeMap, m_DesignCategoryMap, m_GroupBoxCategoryMap, m_indexFieldsMap, m_MimeMap, m_objectClassesMap, m_PluginCategoryMap, m_PluginMap, m_PluginTypesMap, m_SearchTemplateCategoryMap, m_SelectiveConfigurationMap, m_strDesign, m_VirtualFolderCategoryMap, MS_OFFICE_EMBEDED_DESIGN
 
Fields inherited from interface com.wewebu.ow.server.role.OwRoleManager
m_predefinedcategories, ROLE_ACCESS_MASK_FLAG_DYNAMIC_RESOURCE_MODIFY, ROLE_ACCESS_MASK_FLAG_INDEX_FIELD_MODIFY, ROLE_ACCESS_MASK_FLAG_INDEX_FIELD_VIEW, ROLE_ACCESS_MASK_FLAG_OBJECT_CLASSES_CHECKIN, ROLE_ACCESS_MASK_FLAG_OBJECT_CLASSES_CREATE, ROLE_ACCESS_MASK_FLAG_OBJECT_CLASSES_VIEW, ROLE_ACCESS_RIGHT_ALLOWED, ROLE_ACCESS_RIGHT_DENIED, ROLE_ACCESS_RIGHT_NOT_ALLOWED, ROLE_CATEGORY_DESIGN, ROLE_CATEGORY_INDEX_FIELDS, ROLE_CATEGORY_OBJECT_CLASSES, ROLE_CATEGORY_PLUGIN, ROLE_CATEGORY_SEARCH_TEMPLATE, ROLE_CATEGORY_SELECTIVE_CONFIGURATION, ROLE_CATEGORY_STANDARD_FUNCTION, ROLE_CATEGORY_STARTUP_FOLDER, ROLE_CATEGORY_USER_START, ROLE_CATEGORY_VIRTUAL_FOLDER, ROLE_CATEGORY_VIRTUAL_QUEUE, ROLE_RESOURCE_CONTEXT_CHECKIN, ROLE_RESOURCE_CONTEXT_CREATE, ROLE_RESOURCE_CONTEXT_VIEW, STD_FUNC_CAN_EDIT_SITE_SETTINGS
 
Constructor Summary
OwDummyRoleManager()
           
 
Method Summary
 boolean canExplicitDeny()
           
 Collection getAllowedResources(int category_p)
          get all resources the current user has access to for a given category
 Collection getFilteredRoles()
          get filtered roles through the selected master role group
 String getMasterRole()
          get the role that is currently selected for the user
 String getMasterRoleDisplayName(Locale locale_p, String strRole_p)
          get a displayname for the given role
 Collection getMasterRoles()
          get a list of roles that can be selected for the current user
 boolean hasMasterRoles()
          check if selectable roles are supported by rolemanager for the current user
 void init(com.wewebu.ow.server.role.OwRoleManagerContext mainContext_p, com.wewebu.ow.server.util.OwXMLUtil configNode_p)
          init the manager, set context optionally set a prefix to distinguish several different applications.
 boolean isAllowed(int iCategory_p, String strResourceID_p)
          checks if the current user designated by its credentials is allowed to use the given resource / function
 void loginInit()
           
 boolean setMasterRole(String strRole_p)
          set the role that is currently selected for the user
protected  void updateDesign()
          update the design name from db
 
Methods inherited from class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
canPersistAccessMask, dynamicResourceNameFromId, getAccessMask, getAccessRights, getDynamicResources, getPrecalculatedSimpleAccessMasks, hasAccessMaskRight, isGlobalRoleModificationAllowed, replaceResource, setAccessMask, setAccessRights
 
Methods inherited from class com.wewebu.ow.server.role.OwStandardRoleManager
applicationInitalize, canRefreshStaticConfiguration, getAccessMaskDescriptions, getCategories, getCategoryDisplayName, getCategoryMap, getConfigNode, getConfiguredCategories, getContext, getCurrentUser, getDefaultMIMENode, getDesign, getDesignCategoryMap, getGroupBoxCategoryMap, getIndexFieldsMap, getMIMENode, getObjectClassesMap, getPlugin, getPluginCategoryMap, getPlugins, getRepositories, getResourceDisplayName, getResources, getSearchTemplateCategoryMap, getStandardFunctionResourceMap, getVirtualFoldersCategoryMap, isGlobalRole, isInitialized, isMsOfficeEmbedded, isStaticResourceCategory, refreshStaticConfiguration, updateAllowedPlugins
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwDummyRoleManager

public OwDummyRoleManager()
Method Detail

init

public void init(com.wewebu.ow.server.role.OwRoleManagerContext mainContext_p,
                 com.wewebu.ow.server.util.OwXMLUtil configNode_p)
          throws com.wewebu.ow.server.exceptions.OwException
init the manager, set context optionally set a prefix to distinguish several different applications. The rolemanager will filter the allowed plugins, MIME settings and design with the prefix. The default is empty. e.g. used for the Zero-Install Desktop Integration (ZIDI) to display a different set of plugins, MIME table and design for the Zero-Install Desktop Integration (ZIDI)

Specified by:
init in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
init in class com.wewebu.ow.server.role.OwStandardRoleManager
Parameters:
configNode_p - OwXMLUtil node with configuration information
mainContext_p - reference to the main app context of the application
Throws:
com.wewebu.ow.server.exceptions.OwException

loginInit

public void loginInit()
               throws Exception
Specified by:
loginInit in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
loginInit in class com.wewebu.ow.server.role.OwStandardRoleManager
Throws:
Exception

getFilteredRoles

public Collection getFilteredRoles()
                            throws Exception
get filtered roles through the selected master role group

Returns:
Collection of String with filtered roles according to selected master role
Throws:
Exception

isAllowed

public boolean isAllowed(int iCategory_p,
                         String strResourceID_p)
                  throws Exception
checks if the current user designated by its credentials is allowed to use the given resource / function

Specified by:
isAllowed in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
isAllowed in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Parameters:
iCategory_p - of the requested function
strResourceID_p - String ID of the requested resource (function / plugin id)
Returns:
true if user has permission, false if permission is denied
Throws:
Exception

getAllowedResources

public Collection getAllowedResources(int category_p)
                               throws Exception
get all resources the current user has access to for a given category

Specified by:
getAllowedResources in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
getAllowedResources in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Parameters:
category_p - int category for given user
Returns:
Collection of String (resource IDs)
Throws:
Exception

getMasterRoles

public Collection getMasterRoles()
                          throws Exception
get a list of roles that can be selected for the current user

Specified by:
getMasterRoles in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
getMasterRoles in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Returns:
Collection of String, or null if no roles can be selected
Throws:
Exception

getMasterRoleDisplayName

public String getMasterRoleDisplayName(Locale locale_p,
                                       String strRole_p)
                                throws Exception
get a displayname for the given role

Specified by:
getMasterRoleDisplayName in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
getMasterRoleDisplayName in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Parameters:
locale_p - Locale to use
strRole_p - String
Returns:
String displayname for given role
Throws:
Exception

getMasterRole

public String getMasterRole()
                     throws Exception
get the role that is currently selected for the user

Specified by:
getMasterRole in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
getMasterRole in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Returns:
String role, or null if no roles can be selected
Throws:
Exception

updateDesign

protected void updateDesign()
                     throws Exception
update the design name from db

Throws:
Exception

setMasterRole

public boolean setMasterRole(String strRole_p)
                      throws Exception
set the role that is currently selected for the user

Specified by:
setMasterRole in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
setMasterRole in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Parameters:
strRole_p - String
Returns:
boolean true = role changed
Throws:
Exception

canExplicitDeny

public boolean canExplicitDeny()
Specified by:
canExplicitDeny in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
canExplicitDeny in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager

hasMasterRoles

public boolean hasMasterRoles()
check if selectable roles are supported by rolemanager for the current user

Specified by:
hasMasterRoles in interface com.wewebu.ow.server.role.OwRoleManager
Overrides:
hasMasterRoles in class com.wewebu.ow.server.roleimpl.simplerole.OwSimpleRoleManager
Returns:
boolean true = given user has roles


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.