You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ev...@apache.org on 2007/11/08 11:05:52 UTC
svn commit: r593110 - in /maven/continuum/trunk/continuum-xmlrpc:
continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/
continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/
Author: evenisse
Date: Thu Nov 8 02:05:52 2007
New Revision: 593110
URL: http://svn.apache.org/viewvc?rev=593110&view=rev
Log:
Check more authorizations
Modified:
maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java
maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?rev=593110&r1=593109&r2=593110&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java Thu Nov 8 02:05:52 2007
@@ -171,6 +171,9 @@
return continuum.getAllProjectGroupsWithAllDetails();
}
+ /**
+ * @deprecated
+ */
public List<ProjectGroup> getAllProjectGroupsWithProjects()
throws Exception
{
Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java?rev=593110&r1=593109&r2=593110&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java Thu Nov 8 02:05:52 2007
@@ -426,10 +426,9 @@
* Check if the current user is authorized to manage the application's configuration
*
* @throws ContinuumException if the user isn't authorized if the user isn't authenticated
- * @throws ContinuumException if the user isn't authorized if the user isn't authorized
*/
protected void checkManageConfigurationAuthorization()
- throws ContinuumException, ContinuumException
+ throws ContinuumException
{
if ( !isAuthenticated() )
{
@@ -443,10 +442,9 @@
* Check if the current user is authorized to manage the project build schedules
*
* @throws ContinuumException if the user isn't authorized if the user isn't authenticated
- * @throws ContinuumException if the user isn't authorized if the user isn't authorized
*/
protected void checkManageSchedulesAuthorization()
- throws ContinuumException, ContinuumException
+ throws ContinuumException
{
if ( !isAuthenticated() )
{
@@ -454,5 +452,37 @@
}
checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_SCHEDULES );
+ }
+
+ /**
+ * Check if the current user is authorized to manage the installations
+ *
+ * @throws ContinuumException if the user isn't authorized if the user isn't authenticated
+ */
+ protected void checkManageInstallationsAuthorization()
+ throws ContinuumException
+ {
+ if ( !isAuthenticated() )
+ {
+ throw new ContinuumException( "Authentication required." );
+ }
+
+ checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_INSTALLATIONS );
+ }
+
+ /**
+ * Check if the current user is authorized to manage the profiles
+ *
+ * @throws ContinuumException if the user isn't authorized if the user isn't authenticated
+ */
+ protected void checkManageProfilesAuthorization()
+ throws ContinuumException
+ {
+ if ( !isAuthenticated() )
+ {
+ throw new ContinuumException( "Authentication required." );
+ }
+
+ checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_PROFILES );
}
}
Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=593110&r1=593109&r2=593110&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java Thu Nov 8 02:05:52 2007
@@ -227,6 +227,8 @@
private ProjectGroupSummary getPGSummary( int projectGroupId )
throws ContinuumException
{
+ checkViewProjectGroupAuthorization( getProjectGroupName( projectGroupId ) );
+
org.apache.maven.continuum.model.project.ProjectGroup projectGroup =
continuum.getProjectGroup( projectGroupId );
return populateProjectGroupSummary( projectGroup );
@@ -625,6 +627,7 @@
public List<Schedule> getSchedules()
throws ContinuumException
{
+ checkManageSchedulesAuthorization();
Collection schedules = continuum.getSchedules();
List<Schedule> s = new ArrayList<Schedule>();
@@ -639,6 +642,7 @@
public Schedule getSchedule( int scheduleId )
throws ContinuumException
{
+ checkManageSchedulesAuthorization();
return populateSchedule( continuum.getSchedule( scheduleId ) );
}
@@ -669,6 +673,7 @@
public List<Profile> getProfiles()
throws ContinuumException
{
+ checkManageProfilesAuthorization();
Collection profiles = continuum.getProfileService().getAllProfiles();
List<Profile> p = new ArrayList<Profile>();
@@ -683,6 +688,7 @@
public Profile getProfile( int profileId )
throws ContinuumException
{
+ checkManageProfilesAuthorization();
return populateProfile( continuum.getProfileService().getProfile( profileId ) );
}
@@ -693,6 +699,7 @@
public List<Installation> getInstallations()
throws ContinuumException
{
+ checkManageInstallationsAuthorization();
try
{
List<org.apache.maven.continuum.model.system.Installation> installs =
@@ -714,6 +721,7 @@
public Installation getInstallation( int installationId )
throws ContinuumException
{
+ checkManageInstallationsAuthorization();
try
{
org.apache.maven.continuum.model.system.Installation install =
@@ -733,6 +741,7 @@
public SystemConfiguration getSystemConfiguration()
throws ContinuumException
{
+ checkManageConfigurationAuthorization();
try
{
org.apache.maven.continuum.model.system.SystemConfiguration sysConf = store.getSystemConfiguration();