public class AuthorizationDecorator extends Authorization
| Constructor and Description |
|---|
AuthorizationDecorator(Authorization authorization) |
| Modifier and Type | Method and Description |
|---|---|
String |
getUserAttribute(String attributeName)
Returns the value for the specified attribute which is part of JWT.
|
String |
getUserId()
Returns the ID of this current user.
|
String |
getUserName()
Returns the name of this current user.
|
boolean |
hasEntityAccess(String entityName,
String operation)
Checks if current user is granted access to access the given Odata entity to perform
the given operation(READ/WRITE).
|
boolean |
hasUserRole(String roleName)
Checks the current user has the given role or not.
|
boolean |
isAuthenticatedUser(String serviceName)
Checks if current user is authenticated and given OData service requires
authenticated user to access it.
|
boolean |
isRegisteredUser(String serviceName)
Checks if current user is registered user and given OData service requires
registered user to access it.
|
getWhereCondition, rejectRequest, setWhereConditionpublic AuthorizationDecorator(Authorization authorization)
public boolean isAuthenticatedUser(String serviceName)
AuthorizationisAuthenticatedUser in class AuthorizationserviceName - the OData service name.public boolean isRegisteredUser(String serviceName)
AuthorizationisRegisteredUser in class AuthorizationserviceName - the OData service name.public boolean hasEntityAccess(String entityName, String operation)
AuthorizationhasEntityAccess in class AuthorizationentityName - the OData entity name.operation - READ or WRITE.public String getUserName()
AuthorizationgetUserName in class AuthorizationString containing the current principal's user name.public String getUserId()
AuthorizationgetUserId in class AuthorizationString containing the current principal's user id.public boolean hasUserRole(String roleName)
AuthorizationhasUserRole in class AuthorizationroleName - the role name.true if user has the given role otherwise falsepublic String getUserAttribute(String attributeName)
AuthorizationgetUserAttribute in class AuthorizationattributeName - the attribute name same as in JWT token.String if user has the given value for given attribute otherwise nullCopyright © 2020 SAP. All Rights Reserved.