|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- type of the entity encapsulated into the PermissionBean
.public interface AuthorizationHandler<T>
This interface provides the API for implementing a service to validate authorization for asset operations.
The contract enforces implementation of a single method,getPermission
, which decides if a user is authorized to perform
the operation on an asset in a site.
AuthorizationRequestBean
,
PermissionBean
Method Summary | |
---|---|
PermissionBean<T> |
getPermission(AuthorizationRequestBean request)
Decides if a user is authorized to perform the operation on an asset in a site. |
Methods inherited from interface com.fatwire.services.Service |
---|
getManager, getResponse, setManager |
Method Detail |
---|
PermissionBean<T> getPermission(AuthorizationRequestBean request) throws ServiceException
Decides if a user is authorized to perform the operation on an asset in a site.
Typical use of this method is as follows:AuthorizationHandler<MyData> authHandler = ...; // get the service object AuthorizationRequestBean req = ...; // Populate request object PermissionBean<MyData> perm = authHandler.getPermission(); // Response object provides status, status code, messages ServiceResponse resp = perm.getResponse(); // Check success state if (resp.status == Status.SUCCESS.status()) { // If the operation is permitted boolean permitted = perm.isPermitted(); AssetId asset = perm.getAsset(); // Further information MyData data = perm.getEntity(); } else { // Handle error condition MyData data = perm.getEntity(); }
request
- input to this service.
ServiceException
- in case of any server side exceptions. The exception messages and related
error code should be expected in the response object.Function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |