public class BasicRightPolicyFilter extends AbstractPolicyFilter implements RightPolicyFilter, PluginComponent
RightPolicyFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
order
Constructor and Description |
---|
BasicRightPolicyFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
callCanBeReadBy(java.lang.Class clazz)
This convenient method is a simplfied version of
callCanBeReadBy(PublicationCriteria) . |
boolean |
callCanBeReadBy(PublicationCriteria pubCriteria)
|
boolean |
canBeReadBy(boolean isAuthorized,
Category cat,
Group grp,
boolean checkAncestors)
Called by
Category.canBeReadBy(Group, boolean) . |
boolean |
canBeReadBy(boolean isAuthorized,
Category cat,
Member mbr,
boolean searchInGroups,
boolean checkAncestors)
|
boolean |
canBeReadBy(boolean isAuthorized,
Group grp,
Member mbr)
Called by
Group.canBeReadBy(Member) . |
boolean |
canBeReadBy(boolean isAuthorized,
Publication pub,
Group grp)
Called by
Publication.canBeReadBy(Group) . |
boolean |
canBeReadBy(boolean isAuthorized,
Publication pub,
Member mbr,
boolean searchInGroups)
Called by
Publication.canBeReadBy(Member, boolean) . |
boolean |
canCreateContact(boolean isAuthorized,
Member mbr)
Check if the given member can create a new contact.
|
boolean |
canCreateWorkspace(boolean isAuthorized,
Member mbr,
Workspace model)
Check if this member can create workspace :
- ex nihilo if model is null;
- by copiing model if model is not null.
|
boolean |
canDeleteOther(boolean isAuthorized,
Member mbr,
java.lang.Class clazz,
Workspace ws)
Check if this member can delete-other this clazz in at least one of the given workspace.
|
boolean |
canDeleteOther(boolean isAuthorized,
Member mbr,
Data data)
Check if this member can delete-other this instance.
|
boolean |
canManageCategory(boolean isAuthorized,
Member mbr,
Category cat,
boolean searchInGroups,
boolean searchInParent)
|
boolean |
canPublish(boolean isAuthorized,
Member mbr,
java.lang.Class clazz,
java.util.Set wsSet)
Check if this member can publish this clazz in at least one of the given workspace.
|
boolean |
canUpdateOther(boolean isAuthorized,
Member mbr,
java.lang.Class clazz,
Workspace ws)
Check if this member can update-other this clazz in at least one of the given workspace.
|
boolean |
canUpdateOther(boolean isAuthorized,
Member mbr,
Data data)
Check if this member can update-other this instance.
|
boolean |
canUseCategory(boolean isAuthorized,
Member mbr,
Category cat,
boolean searchInGroups,
boolean searchInParent)
|
boolean |
canWorkOn(boolean isAuthorized,
Publication pub,
Member member)
Called by
Member.canWorkOn(Publication) . |
ControllerStatus |
canWorkOn(ControllerStatus status,
int op,
Member mbr,
Member member)
|
java.lang.Boolean |
checkAccess(Member member,
java.lang.String resource,
java.util.Map<java.lang.String,java.lang.Object> context)
The
checkAccess implementation of the BasicRightPolicyFilter does
not modify the default behavior of the AccessControlManager so ACL will be applied
as defined (ie : it returns null). |
boolean |
checkAfterUpload(DocUploadInfo info)
Checks if the uploaded file must be accepted or rejected.
|
boolean |
checkBeforeUpload(java.lang.String fieldName,
java.lang.String contentType,
java.lang.String fileName)
Checks if the uploaded file must be accepted or rejected.
|
ControllerStatus |
checkHtml(java.lang.String str,
java.lang.String field)
This method is called to check if the given string does not
contain forbidden HTML code
|
java.util.Set<Workspace> |
getWorkspaceSet(java.util.Set<Workspace> workspaceSet,
Member mbr)
Retrieve the workspace set of the specified Member.
|
boolean |
init(Plugin plugin)
Initialize the component with the given plugin configuration
|
boolean |
isAdmin(boolean isAdmin,
Member member,
Workspace ws)
Called by
Workspace.isAdmin(Member) . |
boolean |
isWorker(boolean isWorker,
Member member,
Workspace ws)
Called by
Member.isWorker(Workspace) and Member.isWorker() . |
compareTo, equals, getOrder, setOrder
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrder
public static final java.lang.String REVISION
public boolean init(Plugin plugin)
PluginComponent
init
in interface PluginComponent
plugin
- the calling pluginPluginComponent.init(Plugin)
public boolean canUpdateOther(boolean isAuthorized, Member mbr, Data data)
RightPolicyFilter
Member.canUpdateOther(Data)
canUpdateOther
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkdata
- the data to checkRightPolicyFilter.canUpdateOther(boolean, Member, Data)
public boolean canDeleteOther(boolean isAuthorized, Member mbr, Data data)
RightPolicyFilter
Member.canDeleteOther(Data)
canDeleteOther
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkdata
- the data to checkRightPolicyFilter.canDeleteOther(boolean, Member, Data)
public boolean callCanBeReadBy(PublicationCriteria pubCriteria)
RightPolicyFilter
HibernateUtil.queryPublication(PublicationCriteria)
.
It checks if the method RightPolicyFilter.canBeReadBy(boolean, Publication, Member, boolean)
must be called on the results of the query.callCanBeReadBy
in interface RightPolicyFilter
pubCriteria
- the criteria of the query.RightPolicyFilter.canBeReadBy(boolean, Publication, Member, boolean)
must be called.RightPolicyFilter.callCanBeReadBy(PublicationCriteria)
public boolean callCanBeReadBy(java.lang.Class clazz)
callCanBeReadBy(PublicationCriteria)
.clazz
- the class to check (never null)canBeReadBy(boolean, Publication, Member, boolean)
must be called for the given class.public boolean canBeReadBy(boolean isAuthorized, Publication pub, Member mbr, boolean searchInGroups)
RightPolicyFilter
Publication.canBeReadBy(Member, boolean)
. It checks if
a member can read the given publication.
WARNING: HIGHLY SENSIBLE, do not modify without being sure of what you do,
can dramatically impact performance and can break existing rights behaviour.canBeReadBy
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionpub
- the publication to checkmbr
- the member to checksearchInGroups
- if true check if one of the group this
member belongs to is authorized to read this publication.RightPolicyFilter.canBeReadBy(boolean, Publication, Member, boolean)
public boolean canBeReadBy(boolean isAuthorized, Publication pub, Group grp)
RightPolicyFilter
Publication.canBeReadBy(Group)
. It checks if
a group can read this publication.canBeReadBy
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionpub
- the publication to checkgrp
- the group to checkRightPolicyFilter.canBeReadBy(boolean, Publication, Group)
public boolean canWorkOn(boolean isAuthorized, Publication pub, Member member)
RightPolicyFilter
Member.canWorkOn(Publication)
. It checks if the
given member can work on the given publication (ie, if it has the
rights and if it is in a state the member can work in).canWorkOn
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionpub
- the publication to checkmember
- the member to checkRightPolicyFilter.canWorkOn(boolean, Publication, Member)
public ControllerStatus canWorkOn(ControllerStatus status, int op, Member mbr, Member member)
RightPolicyFilter
Member.checkMember(int, Member, java.util.Map)
. It checks if the
given member can work on the given member.canWorkOn
in interface RightPolicyFilter
status
- the internal JCMS controller status.op
- the operation (OP_CREATE, OP_UPDATE, OP_DELETE)mbr
- the member to work onmember
- the member to checkRightPolicyFilter.canWorkOn(ControllerStatus, int, Member, Member)
public boolean isWorker(boolean isWorker, Member member, Workspace ws)
RightPolicyFilter
Member.isWorker(Workspace)
and Member.isWorker()
. It checks
if the given Member is a Worker for the site or the given workspaceisWorker
in interface RightPolicyFilter
isWorker
- true if internal JCMS control authorized the member to perform this actionmember
- the member to checkws
- the workspace to check or null if caller is Member.isWorker()
RightPolicyFilter.isWorker(boolean, Member, Workspace)
public boolean canPublish(boolean isAuthorized, Member mbr, java.lang.Class clazz, java.util.Set wsSet)
RightPolicyFilter
Member.canPublish(Class, Set)
canPublish
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkclazz
- the class to checkwsSet
- the Set ow workspace to work withRightPolicyFilter.canPublish(boolean, Member, Class, Set)
public boolean canUpdateOther(boolean isAuthorized, Member mbr, java.lang.Class clazz, Workspace ws)
RightPolicyFilter
Member.canUpdateOther(Class, Workspace)
canUpdateOther
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkclazz
- the class to checkws
- the Workspace to checkRightPolicyFilter.canUpdateOther(boolean, Member, Class, Workspace)
public boolean canDeleteOther(boolean isAuthorized, Member mbr, java.lang.Class clazz, Workspace ws)
RightPolicyFilter
Member.canDeleteOther(Class, Workspace)
canDeleteOther
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkclazz
- the class to checkws
- the Workspace to checkRightPolicyFilter.canDeleteOther(boolean, Member, Class, Workspace)
public boolean canBeReadBy(boolean isAuthorized, Category cat, Member mbr, boolean searchInGroups, boolean checkAncestors)
RightPolicyFilter
Category.canBeReadBy(Member, boolean, boolean)
. It checks if
a member can read the given category.canBeReadBy
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actioncat
- the category to checkmbr
- the member to checksearchInGroups
- if true check if one of the group this
member belongs to is authorized to read this category.checkAncestors
- if true checks the read rights of the ancestors of this category.RightPolicyFilter.canBeReadBy(boolean, Category, Member, boolean, boolean)
public boolean canBeReadBy(boolean isAuthorized, Category cat, Group grp, boolean checkAncestors)
RightPolicyFilter
Category.canBeReadBy(Group, boolean)
. It checks if
a group can read this category.canBeReadBy
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actioncat
- the category to checkgrp
- the group to checkcheckAncestors
- if true checks the read rights of the ancestors of this category.RightPolicyFilter.canBeReadBy(boolean, Category, Group, boolean)
public boolean canUseCategory(boolean isAuthorized, Member mbr, Category cat, boolean searchInGroups, boolean searchInParent)
RightPolicyFilter
Member.canUseCategory(Category, boolean, boolean)
. It check if a category
can be used by given Member.
Note In current implementation:
canUseCategory
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkcat
- the category to checksearchInGroups
- if true check if one of the group thissearchInParent
- if true check in parent categoryRightPolicyFilter.canUseCategory(boolean, Member, Category, boolean, boolean)
public boolean canManageCategory(boolean isAuthorized, Member mbr, Category cat, boolean searchInGroups, boolean searchInParent)
RightPolicyFilter
Member.canManageCategory(Category, boolean, boolean)
. It check if a category
can be managed by given MembercanManageCategory
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkcat
- the category to checksearchInGroups
- if true check if one of the group thissearchInParent
- if true check in parent categoryRightPolicyFilter.canManageCategory(boolean, Member, Category, boolean, boolean)
public boolean canCreateWorkspace(boolean isAuthorized, Member mbr, Workspace model)
RightPolicyFilter
Member.canCreateWorkspace(Workspace)
canCreateWorkspace
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkmodel
- the workspace to duplicate or null if the workspace has to be created ex nihiloRightPolicyFilter.canCreateWorkspace(boolean, Member, Workspace)
public java.util.Set<Workspace> getWorkspaceSet(java.util.Set<Workspace> workspaceSet, Member mbr)
RightPolicyFilter
This method is called by Member.getWorkspaceSet()
.
You MUST NOT (and cannot) modify the workspaceSet received in parameters, create a
new TreeSet of workspace and return it.
getWorkspaceSet
in interface RightPolicyFilter
workspaceSet
- the workspace set computed by internal JCMS routinembr
- the member for which the workspace set is computedRightPolicyFilter.getWorkspaceSet(Set, Member)
public boolean isAdmin(boolean isAdmin, Member member, Workspace ws)
RightPolicyFilter
Workspace.isAdmin(Member)
. It checks
if the given Member is an administrator for the specified workspace.
If you change the default behavior for a Member, you should also implement
get RightPolicyFilter.getWorkspaceSet(Set, Member)
(see issue JCMS-2601 for a implementation example).
isAdmin
in interface RightPolicyFilter
isAdmin
- true if internal JCMS control found member as admin of workspacemember
- the member to checkws
- the workspace to check, never nullRightPolicyFilter.isAdmin(boolean, Member, Workspace)
public boolean canCreateContact(boolean isAuthorized, Member mbr)
RightPolicyFilter
canCreateContact
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actionmbr
- the member to checkpublic boolean canBeReadBy(boolean isAuthorized, Group grp, Member mbr)
RightPolicyFilter
Group.canBeReadBy(Member)
. It checks if
a member can read this group.canBeReadBy
in interface RightPolicyFilter
isAuthorized
- true if internal JCMS control authorized the member to perform this actiongrp
- the groupmbr
- the memberpublic boolean checkBeforeUpload(java.lang.String fieldName, java.lang.String contentType, java.lang.String fileName)
RightPolicyFilter
checkBeforeUpload
in interface RightPolicyFilter
fieldName
- the name of the field for the given filecontentType
- the content type of the filefileName
- the name of the fileRightPolicyFilter.checkBeforeUpload(String, String, String)
public boolean checkAfterUpload(DocUploadInfo info)
RightPolicyFilter
checkAfterUpload
in interface RightPolicyFilter
info
- information about the uploaded fileRightPolicyFilter.checkAfterUpload(DocUploadInfo)
public ControllerStatus checkHtml(java.lang.String str, java.lang.String field)
RightPolicyFilter
checkHtml
in interface RightPolicyFilter
str
- the String to be checkedfield
- the name of the field which is checkedRightPolicyFilter.checkHtml(String, String)
public java.lang.Boolean checkAccess(Member member, java.lang.String resource, java.util.Map<java.lang.String,java.lang.Object> context)
checkAccess
implementation of the BasicRightPolicyFilter does
not modify the default behavior of the AccessControlManager so ACL will be applied
as defined (ie : it returns null).checkAccess
in interface RightPolicyFilter
member
- the Member for which access right is verifiedresource
- a resource URI using a path representation, eg "admin/dev/store-cleaner"context
- an optionnal context map containing relevant information such as workspace or dataRightPolicyFilter.checkAccess(Member, String, Map)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.