You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2020/08/26 15:28:57 UTC
[archiva-redback-core] branch master updated: Reverted REST V1
changes
This is an automated email from the ASF dual-hosted git repository.
martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva-redback-core.git
The following commit(s) were added to refs/heads/master by this push:
new 8d5027d Reverted REST V1 changes
8d5027d is described below
commit 8d5027db242abdb00571bdf975c40e9b616ac5e5
Author: Martin Stockhammer <ma...@apache.org>
AuthorDate: Wed Aug 26 17:28:42 2020 +0200
Reverted REST V1 changes
---
.../archiva/redback/rest/api/services/RoleManagementService.java | 4 ++--
.../redback/rest/services/DefaultRoleManagementService.java | 8 ++++----
.../archiva/redback/rest/services/RoleManagementServiceTest.java | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/RoleManagementService.java b/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/RoleManagementService.java
index b6cb992..60d04a9 100644
--- a/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/RoleManagementService.java
+++ b/redback-integrations/redback-rest/redback-rest-api/src/main/java/org/apache/archiva/redback/rest/api/services/RoleManagementService.java
@@ -173,7 +173,7 @@ public interface RoleManagementService
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
@RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_RBAC_ADMIN_OPERATION )
- AvailabilityStatus roleExists( @QueryParam( "roleId" ) String roleId )
+ Boolean roleExists( @QueryParam( "roleId" ) String roleId )
throws RedbackServiceException;
/**
@@ -188,7 +188,7 @@ public interface RoleManagementService
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
@RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_RBAC_ADMIN_OPERATION )
- AvailabilityStatus templatedRoleExists( @QueryParam( "templateId" ) String templateId,
+ Boolean templatedRoleExists( @QueryParam( "templateId" ) String templateId,
@QueryParam( "resource" ) String resource )
throws RedbackServiceException;
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java
index 5217132..a80439b 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java
+++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java
@@ -206,12 +206,12 @@ public class DefaultRoleManagementService
return ActionStatus.SUCCESS;
}
- public AvailabilityStatus roleExists( String roleId )
+ public Boolean roleExists( String roleId )
throws RedbackServiceException
{
try
{
- return new AvailabilityStatus( roleManager.roleExists( roleId ) );
+ return roleManager.roleExists( roleId );
}
catch ( RoleManagerException e )
{
@@ -219,12 +219,12 @@ public class DefaultRoleManagementService
}
}
- public AvailabilityStatus templatedRoleExists( String templateId, String resource )
+ public Boolean templatedRoleExists( String templateId, String resource )
throws RedbackServiceException
{
try
{
- return new AvailabilityStatus( roleManager.templatedRoleExists( templateId, resource ) );
+ return roleManager.templatedRoleExists( templateId, resource );
}
catch ( RoleManagerException e )
{
diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/RoleManagementServiceTest.java b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/RoleManagementServiceTest.java
index c51060b..b2de0c3 100644
--- a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/RoleManagementServiceTest.java
+++ b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/RoleManagementServiceTest.java
@@ -51,8 +51,8 @@ public class RoleManagementServiceTest
public void roleExist()
throws Exception
{
- assertTrue( getRoleManagementService( authorizationHeader ).roleExists( "guest" ).isExists() );
- assertFalse( getRoleManagementService( authorizationHeader ).roleExists( "foo" ).isExists() );
+ assertTrue( getRoleManagementService( authorizationHeader ).roleExists( "guest" ) );
+ assertFalse( getRoleManagementService( authorizationHeader ).roleExists( "foo" ) );
}
@Test( expected = ForbiddenException.class )
@@ -61,7 +61,7 @@ public class RoleManagementServiceTest
{
try
{
- assertTrue( getRoleManagementService( null ).roleExists( "guest" ).isExists() );
+ assertTrue( getRoleManagementService( null ).roleExists( "guest" ) );
}
catch ( ForbiddenException e )
{