This week's book giveaway is in the Flex forum.
We're giving away four copies of Flex 4 in Action and have Tariq Ahmed, Dan Orlando, John C. Bland II & Joel Hooks on-line!
See this thread for details.
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » Security
 
RSS feed
 
New topic
Author

How to implement CustomPermissions using JAAS?

satish kumar kandukuri
Greenhorn

Joined: Aug 10, 2005
Messages: 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
Sheriff

Joined: Jan 10, 2002
Messages: 36561

Please read this.

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » Security
 
RSS feed
 
New topic
replay challenge