[JBoss Seam] - Re: Security - Define dynamic Role in application
by markfoerstein
Hi Shane,
Today I finally got my hands on this. My database structure and entities are all set.
Step 2) tricked me, since the getSecurityContext() method is not available inside RuleBasedIdentity.instance(). So Im using the following to get the working memory:
| WorkingMemory wm = ((RuleBasedIdentity) Identity.instance()).getSecurityContext();
|
Im having trouble coding the rule, and I though maybe you could help me. This is the rule (just the same you posted):
| package DynamicPermission
|
| import org.jboss.seam.security.PermissionCheck;
| import com.sphere.consultoria.login.GrantedPermission;
|
| rule GrantDynamicPermission
| no-loop
| activation-group "permissions"
| salience -10
| when
| check: PermissionCheck(granted == false)
| GrantedPermission(n : name -> (n.equals(check.name)), a : action -> (a.equals(check.action)))
| then
| check.grant();
| end;
|
And here is the permission class:
| ...
| public class GrantedPermission implements Serializable {
|
| private String name;
| private String action;
|
| public String getAction() {
| return action;
| }
|
| public void setAction(String action) {
| this.action = action;
| }
|
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| @Override
| public int hashCode() {
| ...
| }
|
| @Override
| public boolean equals(Object obj) {
| ...
| }
| }
|
Im getting...
| 19:52:13,975 INFO [Lifecycle] starting up: org.jboss.seam.security.identity
| 19:52:28,867 ERROR [[/consultoria]] Session event listener threw exception
| org.drools.rule.InvalidRulePackage: Rule Compilation error Private member cannot be accessed from type "DynamicPermission.Rule_GrantDynamicPermission_0". Private member cannot be accessed from type "DynamicPermission.Rule_GrantDynamicPermission_0".
|
| at org.drools.rule.Package.checkValidity(Unknown Source)
| at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
| at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:70)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
I have no idea what's going on. The getters are public in either classes, GrantedPermission and PermissionCheck. So what private member can't be accessed?
Im using:
JBoss 4.0.5
JBoss Seam 1.2.1GA
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043380#4043380
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043380
19 years
[JBoss jBPM] - Trying to build JBPM ear file locally. jbpm-jpdl-3.2.GA work
by meghanai_99
Hello,
I need to build the JBPM ear file locally and deploy to JBoss 4.0.5GA. I could get JBPM working on it using official release jbpm-jpdl-3.2.GA. However when I built the same ear and war files locally, I got following exception - I did not change anything in the source code, only modified hibernate.cfg.xml file
| org.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
| e: (javax.naming.NamingException: ejb-local-ref: 'ejb/LocalTimerServiceBean', wi
| th web.xml ejb-link: 'TimerServiceBean' failed to resolve to an ejb with a Local
| Home)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:380)
|
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
| upport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
| eanSupport.java:245)
|
Can anyone please tell me or point me to a URL on how to build it locally and deploy?
Thank you,
Meghana
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043367#4043367
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043367
19 years