com.atlassian.studio.repository
Interface RepositoryPermissionsManager

All Known Implementing Classes:
DelegatingRepositoryPermissionsManagerImpl

public interface RepositoryPermissionsManager

Facade through which to examine and manipulate Subversion repository permissions.


Field Summary
static String IGNORE_SYSADMIN_GROUP
          Used to hide the system-administrators group from the front end
 
Method Summary
 void deletePathPermissions(String svnPath)
          Removes permissions applied to a path allowing higher-up permissions to be automatically applied.
 RepositoryPermissions getInitialPermissions()
           
 List<String> getNonProjectPaths()
          Returns map of svn paths that are not roots of any Fisheye Repository and permissions for each path.
 RepositoryPermissions getPathPermissions(String svnPath)
           
 RepositoryPermissions getPermissions(String repositoryKey)
           
 String getSvnPathForFisheyeRepository(String repositoryKey)
          The repository key in FishEye and the SVN path corresponding to that key may be different.
 void reset()
          Resets the cache of Fisheye to Svn mapping
 void setDefaultPermissions(RepositoryPermissions permissions)
          Sets the default permissions that will be applied to new repositories.
 void setPermissions(String repositoryKey, RepositoryPermissions permissions)
          Applies new permissions to a repository.
 void setPermissions(String repositoryKey, String svnPath, RepositoryPermissions permissions)
          Applies new permissions to a repository and a specific SVN path.
 void setRawPermissions(String repositoryKey, String svnPath, RepositoryPermissions permissions)
          Sets the permissions for a path without performing any jiggery-pokery that would usually ensure consistency.
 PermissionsSynchronisationResult synchroniseAllRepositoryPermissions()
          Synchronises the permissions for all project repositories, excluding permissions for non project paths, which are synchronised individually whenever changed.
 

Field Detail

IGNORE_SYSADMIN_GROUP

static final String IGNORE_SYSADMIN_GROUP
Used to hide the system-administrators group from the front end

See Also:
Constant Field Values
Method Detail

getPermissions

RepositoryPermissions getPermissions(String repositoryKey)
                                     throws ApplicationNotFoundException,
                                            ApplicationCommunicationException,
                                            RepositoryNotFoundException
Parameters:
repositoryKey - used to designate the target repository
Returns:
the permissions corresponding to the given repository as designated by repositoryKey
Throws:
ApplicationNotFoundException - if an application primary instance (such as FishEye or Subversion) is not configured properly
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords
RepositoryNotFoundException - if the repository of the given repository key is not found

getPathPermissions

RepositoryPermissions getPathPermissions(String svnPath)
                                         throws ApplicationNotFoundException,
                                                ApplicationCommunicationException
Parameters:
svnPath - used to designate the target path
Returns:
the permissions corresponding to the given path as designated by path
Throws:
ApplicationNotFoundException - if an application primary instance (such as FishEye or Subversion) is not configured properly
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords

setPermissions

void setPermissions(String repositoryKey,
                    String svnPath,
                    RepositoryPermissions permissions)
                    throws ApplicationNotFoundException,
                           RepositoryNotFoundException,
                           ApplicationCommunicationException
Applies new permissions to a repository and a specific SVN path. Useful when creating a new repository or when the usual method of determining permissions is unavailable. In most cases it is best to let the permissions manager figure out the SVN path by calling the setPermissions method which lacks the svnPath parameter.

Parameters:
repositoryKey - the target repository
svnPath - the target svn path corresponding to the repository.
permissions - the new permissions for the target repository
Throws:
ApplicationNotFoundException - if an application primary instance is not configured properly
RepositoryNotFoundException - if the repository of the given repository key is not found
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords

setPermissions

void setPermissions(String repositoryKey,
                    RepositoryPermissions permissions)
                    throws ApplicationNotFoundException,
                           RepositoryNotFoundException,
                           ApplicationCommunicationException
Applies new permissions to a repository. The permissions manager figures out the relevant SVN path.

Parameters:
repositoryKey - the target repository
permissions - the new permissions for the target repository
Throws:
ApplicationNotFoundException - if an application primary instance is not configured properly
RepositoryNotFoundException - if the repository of the given repository key is not found
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords

setDefaultPermissions

void setDefaultPermissions(RepositoryPermissions permissions)
                           throws ApplicationCommunicationException,
                                  ApplicationNotFoundException
Sets the default permissions that will be applied to new repositories. If a repository is created and the defaults are subsequently changed, the new defaults will not be automatically applied to the existing repository.

Parameters:
permissions - the new defaults
Throws:
ApplicationNotFoundException - if an application primary instance is not configured properly
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords

getInitialPermissions

RepositoryPermissions getInitialPermissions()
                                            throws IOException
Returns:
the current permissions that will be applied to new repositories, these permissions will continue to apply to the new repository even if the defaults are later changed; the repository's permissions must be managed manually. The initial permissions are affected by both the default and root permissions.
Throws:
IOException - if the permissions cannot be loaded

synchroniseAllRepositoryPermissions

PermissionsSynchronisationResult synchroniseAllRepositoryPermissions()
                                                                     throws ApplicationCommunicationException,
                                                                            ApplicationNotFoundException
Synchronises the permissions for all project repositories, excluding permissions for non project paths, which are synchronised individually whenever changed.

Returns:
the synchronisation result
Throws:
ApplicationCommunicationException - if the manager is unable to retrieve the current repository mappings from FishEye
ApplicationNotFoundException - if FishEye is not currently linked in AppLinks

getSvnPathForFisheyeRepository

String getSvnPathForFisheyeRepository(String repositoryKey)
The repository key in FishEye and the SVN path corresponding to that key may be different. Use this method to discover the SVN path corresponding to a particular repository key.

Parameters:
repositoryKey - as found in FishEye
Returns:
the corresponding SVN path

getNonProjectPaths

List<String> getNonProjectPaths()
                                throws IOException,
                                       ApplicationNotFoundException,
                                       ApplicationCommunicationException
Returns map of svn paths that are not roots of any Fisheye Repository and permissions for each path.

Returns:
map of svn paths that are not roots of any Fisheye Repository and permissions for each path.
Throws:
IOException - if there is an error reading svn authz file
ApplicationNotFoundException - if an application primary instance is not configured properly
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords

reset

void reset()
Resets the cache of Fisheye to Svn mapping


deletePathPermissions

void deletePathPermissions(String svnPath)
Removes permissions applied to a path allowing higher-up permissions to be automatically applied. In most cases synchroniseAllRepositoryPermissions should be called after this method is invoked.

Parameters:
svnPath - the path whose permissions will be dropped

setRawPermissions

void setRawPermissions(String repositoryKey,
                       String svnPath,
                       RepositoryPermissions permissions)
                       throws RepositoryNotFoundException,
                              ApplicationCommunicationException,
                              ApplicationNotFoundException
Sets the permissions for a path without performing any jiggery-pokery that would usually ensure consistency. Useful when a piece of code needs to manage the permissions at a fine-grained level.

Parameters:
repositoryKey - the project key of the repository, may be null
svnPath - the path whose permissions will be set
permissions - the new permissions
Throws:
ApplicationNotFoundException - if an application primary instance is not configured properly
RepositoryNotFoundException - if the repository of the given repository key is not found
ApplicationCommunicationException - examples of communication errors are timeouts and incorrect passwords


Copyright © 2002-2012 Atlassian. All Rights Reserved.