Reverted REST V1 changes

This commit is contained in:
Martin Stockhammer 2020-08-26 17:28:42 +02:00
parent aae69ef8d0
commit 8d5027db24
3 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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 )
{

View File

@ -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 )
{