[JBoss Portal] - Unable to add security constraint to portlets
by bhupeshs
Hi,
I am using jboss portal 2.4.0-Beta1 with Jboss4.0.4GA and MySql5.0
I am trying to add security-constraint to a portlet, but it is not getting reflected. The security-constrating to a page, however is working fine.
I tried adding security-contraint to a Window, PortletInstance and a Portlet but none of them is working.
for Portlet window, I tried something like this in myPortal-object.xml file and deployed the war, but everyone is able to access the portlet.
| <deployment>
| <parent-ref>default.Dashboard2</parent-ref>
| <if-exists>overwrite</if-exists>
| <window>
| <window-name>ScheduledInterviewsWindow2</window-name>
| <instance-ref>KNXScheduledInterviewsInstance2</instance-ref>
| <default>true</default>
| <region>center</region>
| <height>0</height>
| <security-constraint>
| <policy-permission>
| <role-name>Admin</role-name>
| <action-name>view</action-name>
| </policy-permission>
| </security-constraint>
| </window>
| </deployment>
|
I even tried it for the portlet, by adding the security-constraint in jboss-portlet.xml file
| <portlet>
| <portlet-name>ScheduledInterviewsPortlet2</portlet-name>
| <security></security>
| <security-constraint>
| <policy-permission>
| <role-name>Admin</role-name>
| <action-name>view</action-name>
| </policy-permission>
| </security-constraint>
| </portlet>
|
Even the security for portlet-instance is also not working.
In myPortal-objext.xml
|
| <deployment>
| <if-exists>overwrite</if-exists>
| <instance>
| <instance-name>
| KNXScheduledInterviewsInstance2
| </instance-name>
| <component-ref>
| KenexaDashboard2.ScheduledInterviewsPortlet2
| </component-ref>
| <security-constraint>
| <policy-permission>
| <role-name>Admin</role-name>
| <action-name>view</action-name>
| </policy-permission>
| </security-constraint>
| </instance>
| </deployment>
|
| In Portlet-Instances.xml
|
| <instance>
| <instance-id>KNXScheduledInterviewsInstance2</instance-id>
| <portlet-ref>ScheduledInterviewsPortlet2</portlet-ref>
| <security-constraint>
| <policy-permission>
| <role-name>Admin</role-name>
| <action-name>view</action-name>
| </policy-permission>
| </security-constraint>
| </instance>
I even changed the window_access_denied propery in cong/config.xml from show to hide
<entry key="core.render.window_access_denied">hide</entry>
Am I missing anything else? I even tried to do it from the management console but that didn't work either.
Any help would be greatly appreciated.
Thanks & Regards,
Bhupesh.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959856#3959856
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959856
19 years, 9 months
[JBoss jBPM] - Question about c3p0 in JBPM starters kit 3.1.2
by dgutil
Hi,
I've juste downloaded and installed JBPM starters kit 3.1.2.
What I'd like to do is replace the default hsqldb persistence system by a MySQL db. So, following the instructions, I've made a jbpmtest db and created a jbpm user with full privileges.
I have then successfully generated SQL scripts for a MySQL.
Now I would like to run the test suite and this is where I have a problem.
The ant script for the test suite seems to require a c3p0 library but this library is not present in the folder jbpm/lib/hibernate whereas is was there in starters kit 3.0.3.
What I dit is copy the c3p0-0.8.5.2.jar from 3.0.3 into 3.1.2 and ran the test suite again but it ends up with and InterruptedException.
Does the 3.1.2 test suite really depend on c3p0? Do other parts of JBPM also depend on it? How can I properly run the test suite?
Thanx for any comment.
DgUtil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959851#3959851
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959851
19 years, 9 months
[EJB 3.0] - Fetch join with collection
by jan_bar
Hi,
I can fetch join lazy relation that returns single result, but for collection it doesn't work correctly.
I have Attribute.java:
| @Entity
| public class Attribute implements Serializable {
|
| private Long id;
|
| private List<Resource> resources = new ArrayList<Resource>();
|
| public Attribute() {
| super();
| }
|
| @Id
| @GeneratedValue
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
|
| @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
| public List<Resource> getResources() {
| return resources;
| }
| }
|
and Resource.java:
| @Entity
| public class Resource implements Serializable {
| private Long id;
|
| private int resourceSize = 0;
|
| public Resource() {
| super();
| }
|
| @Id
| @GeneratedValue
| public Long getId() {
| return id;
| }
|
| private void setId(Long id) {
| this.id = id;
| }
|
| public int getResourceSize() {
| return resourceSize;
| }
|
| public void setResourceSize(int resourceSize) {
| this.resourceSize = resourceSize;
| }
| }
|
and a finder:
| public List<Attribute> findWithResource(int resourceSize) {
| return em.createQuery(
| "SELECT ta FROM Attribute ta INNER JOIN FETCH ta.resources r" +
| " WHERE r.resourceSize = :resourceSize")
| .setParameter("resourceSize", resourceSize)
| .getResultList();
| }
|
This should return all attributes that have resource of requested resourceSize with fetched resources.
Database content:
Attribute1: resource1 (resourceSize = 1), resource2 (resourceSize = 1), resource3 (resourceSize = 1)
Attribute2: resource1 (resourceSize = 1), resource2 (resourceSize = 1), resource3 (resourceSize = 1)
The query generated by EJB3 looks correctly:
| select ...
| from Attribute attribute0_
| inner join Attribute_Resource resources1_ on attribute0_.id=resources1_.Attribute_id
| inner join Resource resource2_ on resources1_.resources_id=resource2_.id
| where resource2_.resourceSize=?
|
When I call findWithResource(1), I expect to get two Attributes, each with the three resources loaded. Instead I get six Attributes, each with three resources loaded.
I this bug inside my query, unsupported feature or bug in EJB3?
Thank you for your care, Jan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959849#3959849
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959849
19 years, 9 months