On Monday, February 24, 2003, at 08:02 AM, ron bennatan wrote:
I am trying to programmatically create new security entries.No, thats an authorization action (security check)
Everything works fine apart from the fact that I am not sure how to add permissions for the owner. What I am trying to do is get behavior similar to that attained when you have an registry entry which includes:
<access action="*">
<allow-if-owner
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:org.apache.jetspeed.om.registry.base.BaseSecurityAllowOw ner"/>
</access>
I did not find anything which seems to do the job in SecurityEntry. The closest thing I could find was:
public boolean allowsUser(java.lang.String userName, java.lang.String action, java.lang.String ownerUserName)
but I do not know the owner name (nor do I care - I just want to set it for the current active owner).
How should I proceed about adding this owner permission? If I need to use the above method how to I get the current owner?
SecurityEntry.setAccesses(Vector accesses); Then follow it down, you can call
SecurityAccess.setAllows(Vector allows)
and
SecurityAccess.setAction(String action), which is either * or the permission
So you would use the registry api to get the particular entry, and then start manipulating it
SecurityAccess access = new SecurityAccess();
access.setOwnerAllows(Vector ?)
That seems wrong,. a vector. But thats what it takes. I don't know why. Our design was to have only one <allow-if-owner per <access.
Looks like a bug to me in the castor mapping, but you can still use it for now (with a vector) until its fixed
The Owner Allows should contain SecurityAllows objects
-- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] +01 707 773-4646
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
