File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes How to implement CustomPermissions using JAAS? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Security
Reply Bookmark "How to implement CustomPermissions using JAAS?" Watch "How to implement CustomPermissions using JAAS?" New topic
Author

How to implement CustomPermissions using JAAS?

satish kumar kandukuri
Greenhorn

Joined: Aug 10, 2005
Posts: 6
I am trying to develop CustomPermission class in JAAS by extending BasicPermission class.
When i try to using this cusotmpermission class in JAAS Policy file and i try to read the permissions as below

...
ProtectionDomain domain =
new ProtectionDomain(cs, null,SimpleAuthz.class.getClassLoader(),principals);
....
....
PermissionCollection pcoll = Policy.getPolicy().getPermissions(domain);
Enumeration pcollEnum = pcoll.elements();

I iterate through the enumeration and print out the permissions. It says unresolved for my CustomPermission class even though i have put this class file in the jar file.

RESOURCE NAME.......5::com.gabhart.security.PageLevelAuthPermission
ACTIONS.............5::
PERMISSION..........5:unresolved com.gabhart.security.PageLevelAuthPermission
btnUpdate disable)

If i dont provide this class file in jar i was getting NoClassDefFound, now it doesnt so that means it is able to access the class file, but still says its not resovled. I suspect there should be a way of regsitering this class with Java Security or my approach is wrong.

Please provide me your valuable inputs in using JAAS Custom Permission class in JAAS Policy file. Please provide me steps to do the same.






This message was edited 1 time. Last update was at by Bear Bibeault


Satish Kandukuri.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48842

Please read this.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
 
subject: How to implement CustomPermissions using JAAS?
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com