Package overit.geocall.base.util
Class UserTypeUtil
java.lang.Object
overit.geocall.base.util.UserTypeUtil
Collection of utility to retrieve and manage the user type from its
StaticView.-
Method Summary
Modifier and TypeMethodDescriptionstatic DBViewReturns aDBViewof all the user types with the company.administration grant.static DBViewReturns aDBViewof all the user types with the server.administration grant.static LonggetDefaultUserType(Object caller) Retrieve the default user type.static LonggetDefaultUserType(DBView dbView) Retrieve the default user type from theDBViewpassed in input.static StaticViewUtility to retrieve theStaticViewof user types' table.static DBViewgetUserTypes(Object caller) Utility to retrieve theDBViewof user types' table.static DBViewgetUserTypes(Object caller, boolean filterDeleted) Utility to retrieve theDBViewof user types' table.static voidinvalidateUserTypes(Object caller) Utility to invalidate the user types'StaticViewstatic booleanisUserTypeCompanyAdmin(Long userType, PoolKit pk) Return if the user type in input has the company.administration grant.static booleanisUserTypeCompanyAdmin(Long userType, DBView dbv) Return if the user type in input has the company.administration grant.static booleanisUserTypeSuper(Long userType, PoolKit pk) Return if the user type in input has the server.administration grant.static booleanisUserTypeSuper(Long userType, DBView dbv) Return if the user type in input has the server.administration grant.
-
Method Details
-
getStatic
Utility to retrieve theStaticViewof user types' table. This method uses the factory logic to instantiate theStaticView. The view is ordered onDAOUserTypes.ORDERINGcolumn- Parameters:
caller- Reference to object that calls this utility. The caller must contain a reference to theIdentity- Returns:
- The
StaticViewof user types' table - See Also:
-
getUserTypes
Utility to retrieve theDBViewof user types' table. This method uses the factory logic to instantiate theStaticViewand retrieve theDBViewfrom that with only the visible user types.- Parameters:
caller- Reference to object that calls this utility. The caller must contain a reference to theIdentity- Returns:
- The
DBViewof theStaticViewof user types' table - See Also:
-
getUserTypes
Utility to retrieve theDBViewof user types' table. This method uses the factory logic to instantiate theStaticViewand retrieve theDBViewfrom that. The filterDeleted allow to decide to fill theDBViewwith all records of user types' table or fill with only the ones that are visible.- Parameters:
caller- Reference to object that calls this utility. The caller must contain a reference to theIdentityfilterDeleted-falseto obtain all the records,truefor only the ones that are visible- Returns:
- The
DBViewof theStaticViewof user types' table - See Also:
-
getDefaultUserType
Retrieve the default user type. It is the first type of the user types' table ordered by the order column. The method instances theStaticViewof user types' table using the factory logic to retrieve the default user type and extracts only the visible user types.- Parameters:
caller- Reference to object that calls this utility. The caller must contain a reference to theIdentity- Returns:
- the id of the default user type
- See Also:
-
getDefaultUserType
Retrieve the default user type from theDBViewpassed in input. The default user type is the first row of theDBViewin input without change its order.- Parameters:
dbView-DBViewof user types'StaticView- Returns:
- the id of the default user type
-
invalidateUserTypes
Utility to invalidate the user types'StaticView- Parameters:
caller- Reference to object that calls this utility. The caller must contain a reference to theIdentity
-
isUserTypeSuper
Return if the user type in input has the server.administration grant.- Parameters:
userType- id of the user type to check.pk- instance of thePoolKit.- Returns:
trueif the user type has the server.administration grant, otherwisefalse- Throws:
DAException- in case of a db error.
-
isUserTypeCompanyAdmin
Return if the user type in input has the company.administration grant.- Parameters:
userType- id of the user type to check.pk- instance of thePoolKit.- Returns:
trueif the user type has the company.administration grant, otherwisefalse- Throws:
DAException- in case of a db error.
-
isUserTypeSuper
Return if the user type in input has the server.administration grant.- Parameters:
userType- id of the user type to check.dbv- aDBViewof all the user types with the server.administration grant.- Returns:
trueif the user type has the server.administration grant, otherwisefalse- Throws:
DAException- in case of a db error.
-
isUserTypeCompanyAdmin
Return if the user type in input has the company.administration grant.- Parameters:
userType- id of the user type to check.dbv- aDBViewof all the user types with the company.administration grant.- Returns:
trueif the user type has the company.administration grant, otherwisefalse- Throws:
DAException- in case of a db error.
-
fetchSuperUserTypes
Returns aDBViewof all the user types with the server.administration grant.- Parameters:
pk- instance of thePoolKit.- Returns:
- a
DBViewof all the user types with the server.administration grant. - Throws:
DAException- in case of a db error.
-
fetchCompanyAdminUserTypes
Returns aDBViewof all the user types with the company.administration grant.- Parameters:
pk- instance of thePoolKit.- Returns:
- a
DBViewof all the user types with the company.administration grant. - Throws:
DAException- in case of a db error.
-