public class ServiceSpec
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_DELETE |
static int |
ACCESS_GET |
static int |
ACCESS_POST |
static int |
ACCESS_PUT |
static java.lang.String |
API_URL |
Modifier and Type | Method and Description |
---|---|
int |
getAccessRights(Resources resource)
Which operations are allowed on various resources are specified for
an authenticated user.
|
java.lang.String |
getAuthenticationToken()
Authentication as a user of the service is done with a token.
|
long |
getCustomerId() |
java.util.List<ResourceItem> |
getCustomerList() |
java.lang.String |
getCustomerName() |
java.util.Map<java.lang.String,java.lang.Boolean> |
getFeatures()
The feature set of a user is a suggestion regarding which
features should be available in the user interface of client
applications.
|
long |
getProviderId() |
java.util.List<ResourceItem> |
getProviderList() |
java.lang.String |
getProviderName() |
long |
getUserId() |
java.lang.String |
getUsername() |
boolean |
hasAccessRight(Resources resource,
int op)
Check if the currently authenticated user has the right to perform an
operation (GET, POST, PUT or DELETE) on a specific resource type.
|
boolean |
hasFeature(java.lang.String feature)
Checks if a feature should be available to the currently
authenticated user.
|
boolean |
isRestrictedUser()
An authenticated user may be restricted to only access specific
users in the account.
|
public static final int ACCESS_GET
public static final int ACCESS_POST
public static final int ACCESS_PUT
public static final int ACCESS_DELETE
public static final java.lang.String API_URL
public java.lang.String getUsername()
public java.lang.String getAuthenticationToken()
public long getUserId()
public boolean isRestrictedUser()
public long getCustomerId()
public java.lang.String getCustomerName()
public long getProviderId()
public java.lang.String getProviderName()
public java.util.List<ResourceItem> getCustomerList()
public java.util.List<ResourceItem> getProviderList()
public int getAccessRights(Resources resource)
resource
- an API resource, defined by the enumpublic boolean hasAccessRight(Resources resource, int op)
resource
- an API resource, defined by the enumop
- one of the ACCESS_* constantspublic boolean hasFeature(java.lang.String feature)
feature
- name of featurepublic java.util.Map<java.lang.String,java.lang.Boolean> getFeatures()