add Costant
This commit is contained in:
parent
a49ef41abd
commit
8aa338a5b6
|
@ -27,6 +27,8 @@ import org.gcube.common.encryption.StringEncrypter;
|
|||
@Path("ServiceEndpoint")
|
||||
public class ServiceEndpointResource {
|
||||
|
||||
public static final String ENABLED_ROLE="service-endpoint-key";
|
||||
|
||||
@GET
|
||||
@Path("/{category}")
|
||||
@Produces(MediaType.APPLICATION_XML)
|
||||
|
@ -182,7 +184,7 @@ public class ServiceEndpointResource {
|
|||
log.debug("checking role");
|
||||
String at= AccessTokenProvider.instance.get();
|
||||
try{
|
||||
if (ModelUtils.getAccessTokenFrom(at).getRealmAccess().getRoles().contains("service-endpoint-key" )) {
|
||||
if (ModelUtils.getAccessTokenFrom(at).getRealmAccess().getRoles().contains(ENABLED_ROLE )) {
|
||||
log.info("The client is authorized to see the resource as 'free-to-air'");
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue