|
List Info
Thread: Access rights for copied files
|
|
| Access rights for copied files |

|
2007-07-19 03:49:58 |
Hello again,
I have issues when a file is copied and the user has not
access rights
to the fromfile but only to the tofile.
Say:
[/myproject/trunk]
myuser =
[/myproject/tags]
myuser = rw
a file readme.txt is copied from /myproject/trunk/readme.txt
to
/myproject/tags/label1/readme.txt
With the method getLocations() (see code below), we end up
with a
location which we do not have access rights, and therefore a
403
SVNAuthenticationException is raised.
The only solution I can think of is to be able to get the
peg revision
(not the latest revision as it may not be the lastest
version of the file).
as of course
repository.getFile(original_location, commited_revision),
fileProperties, baos); will fail
whereas
repository.getFile(target_location, peg_revision),
fileProperties,
baos); will work
Any suggestion to get it? or a work around?
Cheers,
JClaude
-------------------------
String oriLoc =
SVNFileManager.getOriginalLocation(path, revision);
repository.getFile(oriLoc, revision),
fileProperties, baos);
public static String getOriginalLocation(String path,
long revision,
SVNRepository repository) {
try { final StringBuffer originalPath =
new
StringBuffer();
ISVNLocationEntryHandler handler = new
ISVNLocationEntryHandler(){
public void
handleLocationEntry(SVNLocationEntry
arg0) throws SVNException {
originalPath.append(arg0.getPath());
}};
repository.getLocations(path,
repository.getLatestRevision(), new long[] ,
handler);
return originalPath.toString();
} catch (SVNException e) {
e.printStackTrace();
return "";
}
}
Authorization issue with getLatestRevision and getLocations
------------------------------------------------------------
---------
To unsubscribe, e-mail: svnkit-users-unsubscribe svnkit.com
For additional commands, e-mail: svnkit-users-help svnkit.com
|
|
| Re: Access rights for copied files |

|
2007-07-20 13:55:16 |
Hello,
Anyone can help on this issue? Is it a SVNKit constaint for
the user to
have read access right for the copied from dir entry?
Thanks in advance for your help,
JClaude
Jean-Claude Antonio a écrit :
> Hello again,
>
> I have issues when a file is copied and the user has
not access rights
> to the fromfile but only to the tofile.
> Say:
> [/myproject/trunk]
> myuser = [/myproject/tags]
> myuser = rw
>
> a file readme.txt is copied from
/myproject/trunk/readme.txt to
> /myproject/tags/label1/readme.txt
>
> With the method getLocations() (see code below), we end
up with a
> location which we do not have access rights, and
therefore a 403
> SVNAuthenticationException is raised.
>
> The only solution I can think of is to be able to get
the peg revision
> (not the latest revision as it may not be the lastest
version of the
> file).
> as of course
> repository.getFile(original_location,
commited_revision),
> fileProperties, baos); will fail
> whereas
> repository.getFile(target_location, peg_revision),
fileProperties,
> baos); will work
>
> Any suggestion to get it? or a work around?
> Cheers,
>
> JClaude
>
> -------------------------
> String oriLoc =
SVNFileManager.getOriginalLocation(path, revision);
> repository.getFile(oriLoc, revision),
fileProperties, baos);
>
> public static String getOriginalLocation(String path,
long revision,
> SVNRepository repository) {
> try { final StringBuffer
originalPath = new
> StringBuffer();
> ISVNLocationEntryHandler handler = new
> ISVNLocationEntryHandler(){
> public void
handleLocationEntry(SVNLocationEntry
> arg0) throws SVNException {
>
originalPath.append(arg0.getPath());
> }};
> repository.getLocations(path,
> repository.getLatestRevision(), new long[] ,
handler);
> return originalPath.toString();
> } catch (SVNException e) {
> e.printStackTrace();
> return "";
> }
> }
>
>
>
>
> Authorization issue with getLatestRevision and
getLocations
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: svnkit-users-unsubscribe svnkit.com
> For additional commands, e-mail: svnkit-users-help svnkit.com
>
>
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: svnkit-users-unsubscribe svnkit.com
For additional commands, e-mail: svnkit-users-help svnkit.com
|
|
| Re: Access rights for copied files |

|
2007-07-20 14:27:05 |
Hello Jean,
Sorry for delay with the answer.
> Anyone can help on this issue? Is it a SVNKit
constaint for the user to
> have read access right for the copied from dir entry?
> Thanks in advance for your help,
I think it is more global Subversion constraint rather than
SVNKit one.
For instance, if you'll run "svn log" on copied
file, path it was copied
from will not be displayed as this is part of repository is
read
protected. Same works for getLocations - one couldn't get
source path in
case it is in read protected path of repository - structure
of this part
is also protected from the user who doesn't have read access
to it.
So, what I could suggest to workaround this problem is to
use revision
you used to get parent folder child entries as
"peg" revision to get
child file contents.
Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java
[Sub]Versioning Library!
Jean-Claude Antonio wrote:
> Hello,
>
> Anyone can help on this issue? Is it a SVNKit constaint
for the user to
> have read access right for the copied from dir entry?
> Thanks in advance for your help,
>
> JClaude
>
> Jean-Claude Antonio a écrit :
>> Hello again,
>>
>> I have issues when a file is copied and the user
has not access rights
>> to the fromfile but only to the tofile.
>> Say:
>> [/myproject/trunk]
>> myuser = [/myproject/tags]
>> myuser = rw
>>
>> a file readme.txt is copied from
/myproject/trunk/readme.txt to
>> /myproject/tags/label1/readme.txt
>>
>> With the method getLocations() (see code below), we
end up with a
>> location which we do not have access rights, and
therefore a 403
>> SVNAuthenticationException is raised.
>>
>> The only solution I can think of is to be able to
get the peg revision
>> (not the latest revision as it may not be the
lastest version of the
>> file).
>> as of course
>> repository.getFile(original_location,
commited_revision),
>> fileProperties, baos); will fail
>> whereas
>> repository.getFile(target_location, peg_revision),
fileProperties,
>> baos); will work
>>
>> Any suggestion to get it? or a work around?
>> Cheers,
>>
>> JClaude
>>
>> -------------------------
>> String oriLoc =
SVNFileManager.getOriginalLocation(path, revision);
>> repository.getFile(oriLoc, revision),
fileProperties, baos);
>>
>> public static String getOriginalLocation(String
path, long revision,
>> SVNRepository repository) {
>> try { final StringBuffer
originalPath = new
>> StringBuffer();
>> ISVNLocationEntryHandler handler =
new
>> ISVNLocationEntryHandler(){
>> public void
handleLocationEntry(SVNLocationEntry
>> arg0) throws SVNException {
>>
originalPath.append(arg0.getPath());
>> }};
>>
repository.getLocations(path,
>> repository.getLatestRevision(), new long[]
, handler);
>> return originalPath.toString();
>> } catch (SVNException e) {
>> e.printStackTrace();
>> return "";
>> }
>> }
>>
>>
>>
>>
>> Authorization issue with getLatestRevision and
getLocations
>>
>>
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail:
svnkit-users-unsubscribe svnkit.com
>> For additional commands, e-mail:
svnkit-users-help svnkit.com
>>
>>
>>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: svnkit-users-unsubscribe svnkit.com
> For additional commands, e-mail: svnkit-users-help svnkit.com
>
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: svnkit-users-unsubscribe svnkit.com
For additional commands, e-mail: svnkit-users-help svnkit.com
|
|
| Re: Access rights for copied files |

|
2007-07-20 14:56:44 |
|
Thanks Alexander!
JCA's signature
Alexander Kitaev a écrit :
svnkit.com" type="cite">Hello
Jean,
Sorry for delay with the answer.
> Anyone can help on this issue? Is it a SVNKit constaint for the
user to
> have read access right for the copied from dir entry?
> Thanks in advance for your help,
I think it is more global Subversion constraint rather than SVNKit one.
For instance, if you'll run "svn log" on copied file, path it was
copied from will not be displayed as this is part of repository is read
protected. Same works for getLocations - one couldn't get source path
in case it is in read protected path of repository - structure of this
part is also protected from the user who doesn't have read access to
it.
So, what I could suggest to workaround this problem is to use revision
you used to get parent folder child entries as "peg" revision to get
child file contents.
Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
Jean-Claude Antonio wrote:
Hello,
Anyone can help on this issue? Is it a SVNKit constaint for the user to
have read access right for the copied from dir entry?
Thanks in advance for your help,
JClaude
Jean-Claude Antonio a écrit :
Hello again,
I have issues when a file is copied and the user has not access rights
to the fromfile but only to the tofile.
Say:
[/myproject/trunk]
myuser = [/myproject/tags]
myuser = rw
a file readme.txt is copied from /myproject/trunk/readme.txt to
/myproject/tags/label1/readme.txt
With the method getLocations() (see code below), we end up with a
location which we do not have access rights, and therefore a 403
SVNAuthenticationException is raised.
The only solution I can think of is to be able to get the peg revision
(not the latest revision as it may not be the lastest version of the
file).
as of course
repository.getFile(original_location, commited_revision),
fileProperties, baos); will fail
whereas
repository.getFile(target_location, peg_revision), fileProperties,
baos); will work
Any suggestion to get it? or a work around?
Cheers,
JClaude
-------------------------
String oriLoc = SVNFileManager.getOriginalLocation(path,
revision);
repository.getFile(oriLoc, revision), fileProperties, baos);
public static String getOriginalLocation(String path, long revision,
SVNRepository repository) {
try { final StringBuffer originalPath = new
StringBuffer();
ISVNLocationEntryHandler handler = new
ISVNLocationEntryHandler(){
public void handleLocationEntry(SVNLocationEntry
arg0) throws SVNException {
originalPath.append(arg0.getPath());
}};
repository.getLocations(path,
repository.getLatestRevision(), new long[] , handler);
return originalPath.toString();
} catch (SVNException e) {
e.printStackTrace();
return "";
}
}
Authorization issue with getLatestRevision and getLocations
---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit.com">svnkit-users-unsubscribe svnkit.com
For additional commands, e-mail: svnkit.com">svnkit-users-help svnkit.com
---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit.com">svnkit-users-unsubscribe svnkit.com
For additional commands, e-mail: svnkit.com">svnkit-users-help svnkit.com
---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit.com">svnkit-users-unsubscribe svnkit.com
For additional commands, e-mail: svnkit.com">svnkit-users-help svnkit.com
|
[1-4]
|
|