0

Zk + spring-security-3.0.0

asked 2009-12-22 16:50:09 +0800

alguineirojunior gravatar image alguineirojunior
18 2

updated 2009-12-23 06:03:52 +0800

Hi, Im using spring-3.0.0.RC2 and spring-security-3.0.0.RC1.

I'm trying to use security tags in my zul pages and I'm having errors. In spring-security-3.0.0.RC1 they changed package names... and ClassNotFoundException is thrown. I updated the zkspring jar to 1.2.0-RC version and the problem persists.

Could someone help me? Someone knows about some versions of zkspring compatible with spring-security-3?


Thank you.

delete flag offensive retag edit

6 Replies

Sort by » oldest newest

answered 2009-12-23 15:30:55 +0800

alguineirojunior gravatar image alguineirojunior
18 2

Fixed,

I created my security.tld and I customized the SecurityUtils.java contained in zkspring.jar to use spring-security-3.0.0.RC1 resources .

Regards.

João Alguineiro.

link publish delete flag offensive edit

answered 2010-01-26 21:11:58 +0800

thaivq gravatar image thaivq
39 1

I encountered the same problem, could you please share your customized zkspring.jar!

Thanks and regards.

link publish delete flag offensive edit

answered 2010-01-27 04:29:06 +0800

alguineirojunior gravatar image alguineirojunior
18 2

updated 2010-01-27 04:31:16 +0800

Hi, firstly I copied the security.tld to /WEB-INF/tld/.
Then I changed <function-class>org.springframework.security....</function-class> to
<function-class>com.green.soft.zk.spring.security.SecurityUtil</function-class>

I created a copy of SecurityUtils.java and I made customizations, like these.

zul file (example of isAllGranted method)


<?taglib uri="/WEB-INF/tld/security.tld" prefix="sec" ?> 
...
<zk if="${sec:isAllGranted('ROLE_AUTO_MOBILE')}">
	<menu label="${c:l('global.auto.mobile')}">
		<menupopup>
			<menuitem id="maintainCarEntryPoint" label="${c:l('global.car')}" apply="com.green.soft.composer.MaintainCarComposer"/>
		</menupopup>	
	</menu>
</zk>


security.tld (example of isAllGranted method)


<function>
	<name>isAllGranted</name>
	<function-class>com.green.soft.zk.spring.security.SecurityUtil</function-class>
	<function-signature>boolean isAllGranted(java.lang.String authorities) {</function-signature>
	<description>Return true if the authenticated principal is granted authorities of ALL the specified roles.</description>
</function>


SecurityUtils.java (example of isAllGranted method)


public static boolean isAllGranted(String authorities) {
	if (null == authorities || "".equals(authorities)) {
	    return false;
	}
	final Collection granted = getPrincipalAuthorities();
	return granted.containsAll(parseAuthoritiesString(authorities));
}

I would like to attach the files but I dont know how to do this hare. Send an email ([email protected]) then I will pass you the files.

Regards,
João Alguineiro

link publish delete flag offensive edit

answered 2010-01-27 11:03:21 +0800

thaivq gravatar image thaivq
39 1

updated 2010-01-27 11:04:42 +0800

I sent you an email ([email protected]), please pass me the files!

Thank you very much.

Thai

link publish delete flag offensive edit

answered 2010-01-27 12:25:10 +0800

alguineirojunior gravatar image alguineirojunior
18 2

Thai, I sent the files for you.

Regards,

João Alguineiro

link publish delete flag offensive edit

answered 2010-01-28 01:37:05 +0800

thaivq gravatar image thaivq
39 1

Thank you.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-22 16:50:09 +0800

Seen: 1,501 times

Last updated: Jan 28 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More