You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by mksong <hi...@gmail.com> on 2009/06/30 19:13:48 UTC
Anyone here using jsec in a Grails + Zk-plugin application?
I moved it here.
-------------
Hi all,
Anyone here using jsec in a Grails + Zk-plugin application?
My problem is that the jsec plugin for grails provides several class for
user, role, permission, and their relationships. i have sucessfully
tested authentication and verifying the user's role. However, I want to
know how i can check for permission in code. I know I have to call
isPermitted() on the current subject, but I don't know how that string
parameter should be formatted.
I think the plugin is setup for grails view technology with
controller/action. Whereas, I just want to simply check for permission
in the wildcard way as documented for jsec WildcardPermission class.
I won't mind the way the jsec plugins for grials has permission setup,
if I can only figure out how to check it in code.
Here is what I have done so far using fixtures:
// create a permission
"aPerm"(JsecPermission){
type = "org.jsecurity.grails.JsecBasicPermission"
possibleActions = "*"
}
menuPerm0(JsecRolePermissionRel){
role = adminRole // JsecRole instance reference, users and roles already
created
permission = ref("aPerm") // the permission above
target = "User" // name of menu I want permission for, remember, this is
not grails controller
actions = "view"
}
Now, in code, I get the current subject and call isPermitted(). I have
tired "User", "User:*", and "User:view". but nothing successful yet.
Thanks for your help or pointers to info.
.v
--
View this message in context: http://n2.nabble.com/Anyone-here-using-jsec-in-a-Grails-%2B-Zk-plugin-application--tp3183915p3183915.html
Sent from the Shiro User mailing list archive at Nabble.com.