|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.policy.AbstractPolicyFilter com.jalios.jcms.policy.BasicRightPolicyFilter
public class BasicRightPolicyFilter
Default implementation of RightPolicyFilter
RightPolicyFilter
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter |
---|
order |
Constructor Summary | |
---|---|
BasicRightPolicyFilter()
|
Method Summary | |
---|---|
boolean |
callCanBeReadBy(Class clazz)
This convenient method is a simplfied version of callCanBeReadBy(PublicationCriteria) . |
boolean |
callCanBeReadBy(PublicationCriteria pubCriteria)
Call by HibernateUtil.queryPublication(PublicationCriteria) . |
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)
Called by Category.canBeReadBy(Member, boolean, boolean) . |
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 |
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,
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)
Called by Member.canManageCategory(Category, boolean, boolean) . |
boolean |
canPublish(boolean isAuthorized,
Member mbr,
Class clazz,
Set wsSet)
Check if this member can publish this clazz in at least one of the given workspace. |
boolean |
canUpdateOther(boolean isAuthorized,
Member mbr,
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)
Called by Member.canUseCategory(Category, boolean, boolean) . |
boolean |
canWorkOn(boolean isAuthorized,
Publication pub,
Member member)
Called by Member.canWorkOn(Publication) . |
ControllerStatus |
canWorkOn(ControllerStatus status,
int op,
Member mbr,
Member member)
Called by Member.checkMember(int, Member, java.util.Map) . |
Boolean |
checkAccess(Member member,
String resource,
Map<String,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(String fieldName,
String contentType,
String fileName)
Checks if the uploaded file must be accepted or rejected. |
ControllerStatus |
checkHtml(String str,
String field)
This method is called to check if the given string does not contain forbidden HTML code |
Set<Workspace> |
getWorkspaceSet(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() . |
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter |
---|
compareTo, equals, getOrder, setOrder |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jalios.jcms.policy.RightPolicyFilter |
---|
getOrder |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public BasicRightPolicyFilter()
Method Detail |
---|
public boolean init(Plugin plugin)
PluginComponent
init
in interface PluginComponent
plugin
- the calling plugin
PluginComponent.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 check
RightPolicyFilter.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 check
RightPolicyFilter.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(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 check
RightPolicyFilter.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 check
RightPolicyFilter.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 check
RightPolicyFilter.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 workspace
isWorker
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, Class clazz, 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 with
RightPolicyFilter.canPublish(boolean, Member, Class, Set)
public boolean canUpdateOther(boolean isAuthorized, Member mbr, 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 check
RightPolicyFilter.canUpdateOther(boolean, Member, Class, Workspace)
public boolean canDeleteOther(boolean isAuthorized, Member mbr, 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 check
RightPolicyFilter.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 category
RightPolicyFilter.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 Member
canManageCategory
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 category
RightPolicyFilter.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 nihilo
RightPolicyFilter.canCreateWorkspace(boolean, Member, Workspace)
public Set<Workspace> getWorkspaceSet(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 computed
RightPolicyFilter.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 null
RightPolicyFilter.isAdmin(boolean, Member, Workspace)
public 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 member
public boolean checkBeforeUpload(String fieldName, String contentType, 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 file
RightPolicyFilter.checkBeforeUpload(String, String, String)
public boolean checkAfterUpload(DocUploadInfo info)
RightPolicyFilter
checkAfterUpload
in interface RightPolicyFilter
info
- information about the uploaded file
RightPolicyFilter.checkAfterUpload(DocUploadInfo)
public ControllerStatus checkHtml(String str, String field)
RightPolicyFilter
checkHtml
in interface RightPolicyFilter
str
- the String to be checkedfield
- the name of the field which is checked
RightPolicyFilter.checkHtml(String, String)
public Boolean checkAccess(Member member, String resource, Map<String,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 data
RightPolicyFilter.checkAccess(Member, String, Map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |