[jboss-user] [JBoss Portal] - Re: Role and portal page Association in JBOSS Portal ?
steux jean-sebastien
do-not-reply at jboss.com
Tue Oct 19 08:58:37 EDT 2010
steux jean-sebastien [http://community.jboss.org/people/jssteux] created the discussion
"Re: Role and portal page Association in JBOSS Portal ?"
To view the discussion, visit: http://community.jboss.org/message/567170#567170
--------------------------------------------------------------
Hi,
There is not a specific API. So we had to use the internal API of JBoss Portal to do so.
Here is an extract
Jean-Sébastien
// Get the page
PortalObject page = getControllerContext().getController().getPortalObjectContainer().getObject(poid);
// Get the DomainConfigurator
DomainConfigurator dc = getControllerContext().getController().getPortalObjectContainer()
.getAuthorizationDomain().getConfigurator();
// Construct the permission
Set<RoleSecurityBinding> newConstraints = new HashSet<RoleSecurityBinding>();
Set<String> secureAction = new HashSet<String>();
secureAction.add(PortalObjectPermission.VIEW_ACTION);
newConstraints.add(new RoleSecurityBinding(secureAction, "myRole"));
// Set the permission
dc.setSecurityBindings(page.getId().toString(PortalObjectPath.CANONICAL_FORMAT), newConstraints);
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/567170#567170]
Start a new discussion in JBoss Portal at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2011]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101019/1ac59740/attachment.html
More information about the jboss-user
mailing list