com.gentics.portal.security
Class AbstractPortalPermissionChecker

java.lang.Object
  extended by com.gentics.portal.security.AbstractPortalPermissionChecker
Direct Known Subclasses:
DummyPermissionChecker, PermissionChecker

public abstract class AbstractPortalPermissionChecker
extends Object

The Class AbstractPortalPermissionChecker.

Provides a basic Permission Check functionality for Portlets.
This class should be Implemented for dedicated portal environments.

There can be specified cms groups for editing and viewing content and navigation elements (folders).
Group Ids for view and edit rights have to be set in the properties file.

 

Field Summary
protected static Integer CMS_ANONYMOUS_GROUP
          The cms anonymous group.
private  com.gentics.cr.CRConfigFileLoader crConf
          The configuration file loader.
private  Map<String,List<Integer>> editRoleMap
          The role map.
private  org.apache.log4j.Logger log
          The log.
private static String PREFIX_EDIT_GROUP
          The edit group prefix.
private static String PREFIX_VIEW_GROUP
          The view group prefix.
protected static String PROPERTY_CMS_ANONYMOUS_GROUP
          The cms anonymous group property string .
private static String PROPERTY_FILENAME
          The Constant Property Filename.
private static String SUFIX_CMS
          The cms suffix.
private static String SUFIX_PORTAL
          The portal suffix.
private  Map<String,List<Integer>> viewRoleMap
          The role map.
 
Constructor Summary
AbstractPortalPermissionChecker()
           
 
Method Summary
abstract  Boolean checkEditPermission(javax.portlet.PortletRequest request, com.gentics.cr.CRResolvableBean bean)
          Checks the write permission for the given crBean.
abstract  Boolean checkViewPermission(javax.portlet.PortletRequest request, com.gentics.cr.CRResolvableBean bean)
          Check the view permissions for the given crBean.
private  void fillRoleMap()
          Fill the role maps with the given permission groups.
protected  Map<String,List<Integer>> getEditRoleMap()
          Getter method for editRoleMap.
abstract  Subject getSubject(javax.portlet.PortletRequest request)
          Returns the User Subject.
protected  Map<String,List<Integer>> getViewRoleMap()
          Getter method for viewRoleMap.
 void init()
          Initialize the PortalPermissionChecker and builds the role map.
abstract  Boolean isLoggedIn(javax.portlet.PortletRequest request)
          Checks if a user is logged in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.log4j.Logger log
The log.


PROPERTY_FILENAME

private static final String PROPERTY_FILENAME
The Constant Property Filename.

See Also:
Constant Field Values

CMS_ANONYMOUS_GROUP

protected static Integer CMS_ANONYMOUS_GROUP
The cms anonymous group.


PROPERTY_CMS_ANONYMOUS_GROUP

protected static String PROPERTY_CMS_ANONYMOUS_GROUP
The cms anonymous group property string .


PREFIX_VIEW_GROUP

private static String PREFIX_VIEW_GROUP
The view group prefix.


PREFIX_EDIT_GROUP

private static String PREFIX_EDIT_GROUP
The edit group prefix.


SUFIX_PORTAL

private static String SUFIX_PORTAL
The portal suffix.


SUFIX_CMS

private static String SUFIX_CMS
The cms suffix.


viewRoleMap

private Map<String,List<Integer>> viewRoleMap
The role map. Maps the connection of portal user view roles and CMS groups


editRoleMap

private Map<String,List<Integer>> editRoleMap
The role map. Maps the connection of portal user edit roles and CMS groups


crConf

private com.gentics.cr.CRConfigFileLoader crConf
The configuration file loader.

Constructor Detail

AbstractPortalPermissionChecker

public AbstractPortalPermissionChecker()
Method Detail

init

public void init()
Initialize the PortalPermissionChecker and builds the role map.


fillRoleMap

private void fillRoleMap()
Fill the role maps with the given permission groups.


getViewRoleMap

protected Map<String,List<Integer>> getViewRoleMap()
Getter method for viewRoleMap.

Returns:
viewRoleMap

getEditRoleMap

protected Map<String,List<Integer>> getEditRoleMap()
Getter method for editRoleMap.

Returns:
editRoleMap

checkViewPermission

public abstract Boolean checkViewPermission(javax.portlet.PortletRequest request,
                                            com.gentics.cr.CRResolvableBean bean)
Check the view permissions for the given crBean.

Parameters:
request - the request
bean - the bean
Returns:
true if the User has view permissions

checkEditPermission

public abstract Boolean checkEditPermission(javax.portlet.PortletRequest request,
                                            com.gentics.cr.CRResolvableBean bean)
Checks the write permission for the given crBean.

Parameters:
request - the request
bean - the bean
Returns:
true if the current User has write permissions

isLoggedIn

public abstract Boolean isLoggedIn(javax.portlet.PortletRequest request)
Checks if a user is logged in.

Parameters:
request - the request
Returns:
true if a user is logged in

getSubject

public abstract Subject getSubject(javax.portlet.PortletRequest request)
                            throws NamingException
Returns the User Subject.

Parameters:
request - the request
Returns:
the User Subject
Throws:
NamingException - the naming exception


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.