[JBoss Seam] - Re: Security - Define dynamic Role in application
by markfoerstein
Hi Shane,
I don't know what stsheak wants exactly, but I was about to ask a similar question, so I will use this topic instead of opening a new one.
I've successfully implemented authentication and authorization using Seam security. It works great.
I defined my roles on the database and bound many roles to one user, and many users to one role. When the user logs in, I get his roles. That's ok and works perfectly.
I defined permissions using JBoss Rules. Then I annotated the methods with @Restrict, configured the exceptions on pages.xml, etc... That's ok and works perfectly.
JBoss Rules is nice, but it would be better if I could get the roles permissions from the database. How can I do that and still use Seam security annotations like @Restrict to validate authorization?
The problem is, when creating a new role or changing permissions, I have to edit drool's security files to explicity set the permissions, which means that every new role and permission must be done changing application code.
What I want is to have an "admin" user log in the application, access a "create/edit role" action, define its permissions and bind the roles to the users (this last one I can do already).
That way, I don't need to change my application code, no redeploy, and no hard-coded permissions into drool's files. The "admin" user is free to do what he wants.
Thanks for any help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039958#4039958
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039958
19 years
[JCA/JBoss] - Re: WrappedResultSet cast excpetion
by mhammam
Weston,
When i don't add the jboss-common-jdbc-wrapper.jar in myapplication/lib directory, my application was successfly loaded.
But when i add it, the following error was shown :
java.lang.UnsupportedOperationException: Do not know how to handle method=public abstract long java.sql.Blob.length() throws java.sql.SQLException
at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:247)
at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy62.length(Unknown Source)
and my code is :
final Blob blob = rs.getBlob(names[0]);
return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039957#4039957
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039957
19 years
[JBoss jBPM] - conditional trans in 3.2 - deprecated syntax doesn't work at
by cristim1979
Hi,
I had this problem: some process definition using decisions worked well on JBPM 3.1.4, but when I tried upgrading to 3.2GA, decision nodes didn't work correctly anymore: they always chose the default transition.
After some work, I've seen that the conditions simply do not work in that syntax - using the 'expression' as ATTRIBUTE of the condition tag - but work in the alternate one: using expression as child element.
>From the 3.2 userguide (section 18.4.29. condition):
"{content} For backwards compatibility, the condition can also be entered with the 'expression' attribute, but that attribute is deprecated since 3.2"
If it's still allowed (even deprecated), I was expecting it to still work, somehow (to keep backward compatibility) - or else the schema to be changed to give clear error on this.
Is this a real problem / should it be fixed somehow ?!..
JUnit for this:
| import junit.framework.TestCase;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| /**
| * JUnit test of JBPM to check issues regarding the sintax of conditional transitions.<br>
| * In 3.2 it seems that using the 'expression' ATTRIBUTE of the <condition> tag does not
| * work! (but only the alternative, where the expression is passed as a child element of the tag!)
| */
| public class TestDecisionAndConditionalTransitions extends TestCase
| {
| public void testDecision( )
| {
| String def1 = "<process-definition>" + " <start-state>" + " <transition to='d' />"
| + " </start-state>" + " <decision name='d'>"
| + " <transition name='t1' to='a'>"
| + " <condition>#{a == '1'}</condition>" + " </transition>"
| + " <transition name='t2' to='b'>"
| + " <condition>#{a == '2'}</condition>" + " </transition>"
| + " <transition name='t3' to='c'>"
| + " <condition>#{a == '3'}</condition>" + " </transition>"
| + " </decision>" + " <state name='a' />" + " <state name='b' />"
| + " <state name='c' />" + "</process-definition>";
|
| String def2 = "<process-definition>" + " <start-state>" + " <transition to='d' />"
| + " </start-state>" + " <decision name='d'>"
| + " <transition name='t1' to='a'>"
| + " <condition expression=\"#{a == '1'\"/>" + " </transition>"
| + " <transition name='t2' to='b'>"
| + " <condition expression=\"#{a == '2'\"/>" + " </transition>"
| + " <transition name='t3' to='c'>"
| + " <condition expression=\"#{a == '3'\"/>" + " </transition>"
| + " </decision>" + " <state name='a' />" + " <state name='b' />"
| + " <state name='c' />" + "</process-definition>";
|
| ProcessDefinition processDefinition1 = ProcessDefinition.parseXmlString( def1 );
| ProcessDefinition processDefinition2 = ProcessDefinition.parseXmlString( def2 );
|
| //test def 1 - should work
| ProcessInstance processInstance = new ProcessInstance( processDefinition1 );
| processInstance.getContextInstance( ).setVariable( "a", "2" );
| processInstance.signal( );
| assertEquals( processDefinition1.getNode( "b" ),
| processInstance.getRootToken( ).getNode( ) );
|
| //test def 2 - doesn't work on JBPM 3.2 ? (but used to work on 3.1.4 ?)
| ProcessInstance processInstance2 = new ProcessInstance( processDefinition2 );
| processInstance2.getContextInstance( ).setVariable( "a", "2" );
| processInstance2.signal( );
| assertEquals( processDefinition2.getNode( "b" ),
| processInstance2.getRootToken( ).getNode( ) );
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039955#4039955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039955
19 years