Package com.skava.helper
Class AccessControlHelper
java.lang.Object
com.skava.helper.AccessControlHelper
This class hold the set of methods for access control using the authorization component of
skava framework.
- Author:
- Infosys Equinox
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
UNAUTHORIZED_ACCESS_EXstatic final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkingRoles
(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, long userId, long collectionId, String locale) static Long
getAdminOrUserId
(com.skava.core.auth.AuthTokenHandler authTokenHandler) This method will return admin userid if it is 0 then return useridstatic boolean
hasSelfAccess
(Long userIdFromToken, Long userId) This method return the accessibility result of self access.static void
preAuthorize
(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, long userId, long collectionId, long businessId, String locale) This method is used to check pre authorize by checking user id and privileges for business id.static void
preAuthorize
(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, long userId, long collectionId, String locale) This method is used to check pre authorize by checking user id and privileges for business id.static void
preAuthorize
(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, String locale, long collectionId, long businessId) This method is used to check pre authorize by checking user id and privileges for business id.static void
preAuthorize
(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, List<Long> userIds, long collectionId, long businessId, String locale) This method is used to check pre authorize by checking user id and privileges for business id.
-
Field Details
-
USER_SERVICE
- See Also:
-
PRIVILEGE_FOR_PATCH_UPDATE_USER
- See Also:
-
PRIVILEGE_FOR_VIEW_ALL_USERS
- See Also:
-
PRIVILEGE_FOR_VIEW_USER
- See Also:
-
PRIVILEGE_FOR_VIEW_USER_PUBLIC_PROFILE
- See Also:
-
PRIVILEGE_FOR_DELETE_USER
- See Also:
-
PRIVILEGE_FOR_UPDATE_PA55WORD
- See Also:
-
PRIVILEGE_FOR_GET_SECURITY_QUESTIONS
- See Also:
-
PRIVILEGE_FOR_UPDATE_SECURITY_QUESTIONS
- See Also:
-
PRIVILEGE_FOR_CREATE_ADDRESS
- See Also:
-
PRIVILEGE_FOR_UPDATE_ADDRESS
- See Also:
-
PRIVILEGE_FOR_VIEW_ALL_ADDRESS
- See Also:
-
PRIVILEGE_FOR_VIEW_ADDRESS
- See Also:
-
PRIVILEGE_FOR_DELETE_ADDRESS
- See Also:
-
PRIVILEGE_FOR_CREATE_USER_CONSENT
- See Also:
-
PRIVILEGE_FOR_VIEW_ALL_USER_CONSENT
- See Also:
-
PRIVILEGE_FOR_DELETE_USER_CONSENT
- See Also:
-
PRIVILEGE_FOR_VIEW_ALL_USER_CONSENT_HISTORY
- See Also:
-
PRIVILEGE_FOR_GETALL_USER_CUSTOMPROPERTIES
- See Also:
-
PRIVILEGE_FOR_GET_USER_CUSTOMPROPERTIES
- See Also:
-
PRIVILEGE_FOR_PATCH_USER_CUSTOMPROPERTIES
- See Also:
-
PRIVILEGE_FOR_DELETE_USER_CUSTOMPROPERTIES
- See Also:
-
PRIVILEGE_FOR_GET_USER_IDENTITIES
- See Also:
-
PRIVILEGE_FOR_CREATE_USER_NOTES
- See Also:
-
PRIVILEGE_FOR_GETALL_USER_NOTES
- See Also:
-
PRIVILEGE_FOR_DELETE_USER_NOTES
- See Also:
-
PRIVILEGE_FOR_POST_USER_NOTIFICATION
- See Also:
-
PRIVILEGE_FOR_PATCH_USER_NOTIFICATION
- See Also:
-
PRIVILEGE_FOR_POST_CONSENT
- See Also:
-
PRIVILEGE_FOR_GET_CONSENT
- See Also:
-
PRIVILEGE_FOR_GETALL_CONSENT
- See Also:
-
PRIVILEGE_FOR_PATCH_CONSENT
- See Also:
-
PRIVILEGE_FOR_DELETE_CONSENT
- See Also:
-
PRIVILEGE_FOR_VIEW_COLLECTIONS
- See Also:
-
UNAUTHORIZED_ACCESS_EX
UNAUTHORIZED_ACCESS_EX- See Also:
-
-
Method Details
-
hasSelfAccess
This method return the accessibility result of self access. It checks whether the token userid and userid from request remains same. -
preAuthorize
public static void preAuthorize(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, List<Long> userIds, long collectionId, long businessId, String locale) This method is used to check pre authorize by checking user id and privileges for business id.- Parameters:
authTokenHandler
- HoldsAuthTokenHandler
object for getting userid from token and check privileges for business iduserCommonServices
- aUserCommonServices
object for loading message source.privilege
- aString
object. Indicates the privilege of the user.userIds
- aList
ofLong
objects. Indicates the user ids.collectionId
- aLong
object. Indicates the collection id.businessId
- aLong
object. Indicates the business id.locale
- aString
object. Indicates the locale object.
-
preAuthorize
public static void preAuthorize(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, long userId, long collectionId, long businessId, String locale) This method is used to check pre authorize by checking user id and privileges for business id.- Parameters:
authTokenHandler
- HoldsAuthTokenHandler
object for getting userid from token and check privileges for business iduserCommonServices
- aUserCommonServices
object for loading message source.privilege
- aString
object. Indicates the privilege of the user.userId
- aList
ofLong
objects. Indicates the user id.collectionId
- aLong
object. Indicates the collection id.businessId
- aLong
object. Indicates the business id.locale
- aString
object. Indicates the locale object.
-
checkingRoles
public static void checkingRoles(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, long userId, long collectionId, String locale) -
preAuthorize
public static void preAuthorize(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, long userId, long collectionId, String locale) This method is used to check pre authorize by checking user id and privileges for business id.- Parameters:
authTokenHandler
- HoldsAuthTokenHandler
object for getting userid from token and check privileges for business iduserCommonServices
- aUserCommonServices
object for loading message source.privilege
- aString
object. Indicates the privilege of the user.userId
- aList
ofLong
objects. Indicates the user id.collectionId
- aLong
object. Indicates the collection id.locale
- aString
object. Indicates the locale object.
-
preAuthorize
public static void preAuthorize(com.skava.core.auth.AuthTokenHandler authTokenHandler, UserCommonServices userCommonServices, String privilege, String locale, long collectionId, long businessId) This method is used to check pre authorize by checking user id and privileges for business id.- Parameters:
authTokenHandler
- HoldsAuthTokenHandler
object for getting userid from token and check privileges for business iduserCommonServices
- aUserCommonServices
object for loading message source.privilege
- aString
object. Indicates the privilege of the user.locale
- aString
object. Indicates the locale object.collectionId
- aLong
object. Indicates the collection id.businessId
- aLong
object. Indicates the business id.
-
getAdminOrUserId
This method will return admin userid if it is 0 then return userid- Parameters:
authTokenHandler
- authTokenHandler- Returns:
- long adminid or userid
-