You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by David Jencks <da...@yahoo.com> on 2006/01/19 02:55:18 UTC
Question about FolderPermission
I'm not sure I understand how FolderPermission works yet, but I
wonder....
FolderPermission A = new FolderPermission("/-", "view");
FolderPermission B = new FolderPermission("/", "view");
should A.implies(B)?
I would expect so, but currently it doesn't.
If it should, I can see two ways to make it happen:
1. make B.folder == true.
2. make the condition when A is a recursive folder and B is not a folder
((that.cpath.length() >= this.cpath.length()) && that.cpath.startsWith
(this.cpath));
(i.e. length allowed to be equal).
Am I missing something? Is one of these better than the other?
thanks
david jencks
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
Re: Question about FolderPermission
Posted by Randy Watler <wa...@wispertel.net>.
Oh, and BTW, the >= test is used in the original.
Randy
Randy Watler wrote:
> David,
>
> This class in patterned off of the standard Java FilePermission
> implementation:
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/io/FilePermission.html
>
> I find the description here ambiguous as well. However, if you look
> through the J2SE code, it does appear that your assertion is true: A
> does seem
> to imply B.
>
> Randy
>
> David Jencks wrote:
>> I'm not sure I understand how FolderPermission works yet, but I
>> wonder....
>>
>> FolderPermission A = new FolderPermission("/-", "view");
>> FolderPermission B = new FolderPermission("/", "view");
>>
>> should A.implies(B)?
>>
>> I would expect so, but currently it doesn't.
>>
>> If it should, I can see two ways to make it happen:
>>
>> 1. make B.folder == true.
>> 2. make the condition when A is a recursive folder and B is not a folder
>>
>> ((that.cpath.length() >= this.cpath.length()) &&
>> that.cpath.startsWith(this.cpath));
>>
>> (i.e. length allowed to be equal).
>>
>> Am I missing something? Is one of these better than the other?
>>
>> thanks
>> david jencks
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
Re: Question about FolderPermission
Posted by Randy Watler <wa...@wispertel.net>.
David,
This class in patterned off of the standard Java FilePermission
implementation:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/FilePermission.html
I find the description here ambiguous as well. However, if you look
through the J2SE code, it does appear that your assertion is true: A
does seem
to imply B.
Randy
David Jencks wrote:
> I'm not sure I understand how FolderPermission works yet, but I
> wonder....
>
> FolderPermission A = new FolderPermission("/-", "view");
> FolderPermission B = new FolderPermission("/", "view");
>
> should A.implies(B)?
>
> I would expect so, but currently it doesn't.
>
> If it should, I can see two ways to make it happen:
>
> 1. make B.folder == true.
> 2. make the condition when A is a recursive folder and B is not a folder
>
> ((that.cpath.length() >= this.cpath.length()) &&
> that.cpath.startsWith(this.cpath));
>
> (i.e. length allowed to be equal).
>
> Am I missing something? Is one of these better than the other?
>
> thanks
> david jencks
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org