Anyone here using jsec in a Grails + Zk-plugin application?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Anyone here using jsec in a Grails + Zk-plugin application?

mksong
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