Package org.ametys.plugins.blog.rights
Class BlogRightsContextConvertor
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.blog.rights.BlogRightsContextConvertor
-
- All Implemented Interfaces:
RightContextConvertor
,Contextualizable
,LogEnabled
,Serviceable
public class BlogRightsContextConvertor extends AbstractLogEnabled implements RightContextConvertor, Serviceable, Contextualizable
This implementation converts any context in a blog-type site to "/cms". Thus, having a right on the application context is considered having it on any context.
-
-
Field Summary
Fields Modifier and Type Field Description private Context
_context
private SiteManager
_siteManager
-
Constructor Summary
Constructors Constructor Description BlogRightsContextConvertor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
Set<Object>
convert(Object object)
Converts the object.protected boolean
isBlogContext(Object context)
Test if the context is a blog site's context.void
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_siteManager
private SiteManager _siteManager
-
-
Constructor Detail
-
BlogRightsContextConvertor
public BlogRightsContextConvertor()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
convert
public Set<Object> convert(Object object)
Description copied from interface:RightContextConvertor
Converts the object.- Specified by:
convert
in interfaceRightContextConvertor
- Parameters:
object
- The initial object- Returns:
- The converted objects. A non-null set, that does not contains the initial object. So if you do not support the object to convert, you must return an empty set.
-
isBlogContext
protected boolean isBlogContext(Object context)
Test if the context is a blog site's context.- Parameters:
context
- the context to test.- Returns:
- true if the context belongs to a blog site, false otherwise.
-
-