Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
Fixed authorization URI when project path has trailing separator
Browse files Browse the repository at this point in the history
  • Loading branch information
jarthorn committed Feb 3, 2011
1 parent c0bd482 commit 3e6d2db
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -238,8 +238,15 @@ private boolean handleAddProject(HttpServletRequest request, HttpServletResponse

// add user rights for the project
try {
AuthorizationService.addUserRight(request.getRemoteUser(), URI.create(result.getString(ProtocolConstants.KEY_LOCATION)).getPath());
AuthorizationService.addUserRight(request.getRemoteUser(), URI.create(result.getString(ProtocolConstants.KEY_LOCATION)).getPath() + "/*");
String locationPath = URI.create(result.getString(ProtocolConstants.KEY_LOCATION)).getPath();
//right to access the location
AuthorizationService.addUserRight(request.getRemoteUser(), locationPath);
//right to access all children of the location
if (locationPath.endsWith("/")) //$NON-NLS-1$
locationPath += "*"; //$NON-NLS-1$
else
locationPath += "/*"; //$NON-NLS-1$
AuthorizationService.addUserRight(request.getRemoteUser(), locationPath);
} catch (CoreException e) {
statusHandler.handleRequest(request, response, e.getStatus());
}
Expand Down

0 comments on commit 3e6d2db

Please sign in to comment.