Class OrgUtils
- java.lang.Object
-
- de.hybris.platform.commerceservices.organization.utils.OrgUtils
-
public final class OrgUtils extends java.lang.Object
Organization utils class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
containsOrgAdminGroup(java.util.Collection<? extends PrincipalGroupModel> groups)
Checks whether the a collection of principal groups contains a group that has the organizational admin role assigned.static <T extends PrincipalModel>
OrgUnitMemberParameter<T>createOrgUnitMemberParameter(java.lang.String uid, java.util.Set<T> members, java.lang.Class<T> type, PageableData pageableData)
Creates the org unit member parameter.static java.util.List<java.lang.String>
getRoleUids()
Gets the role uids that are configured in project.properties file.static boolean
isAdmin(EmployeeModel employee)
Checks whether the given employee is the admin of an organizational unit.protected static boolean
isAdminRole(java.lang.String roleUid)
-
-
-
Method Detail
-
getRoleUids
public static java.util.List<java.lang.String> getRoleUids()
Gets the role uids that are configured in project.properties file.- Returns:
- a list of role uids
-
isAdmin
public static boolean isAdmin(EmployeeModel employee)
Checks whether the given employee is the admin of an organizational unit.- Parameters:
employee
- the employee to check- Returns:
true
if the employee is an admin,false
otherwise
-
containsOrgAdminGroup
public static boolean containsOrgAdminGroup(java.util.Collection<? extends PrincipalGroupModel> groups)
Checks whether the a collection of principal groups contains a group that has the organizational admin role assigned.- Parameters:
groups
- the collection of groups to check- Returns:
true
if the collection contains an admin group,false
otherwise
-
isAdminRole
protected static boolean isAdminRole(java.lang.String roleUid)
-
createOrgUnitMemberParameter
public static <T extends PrincipalModel> OrgUnitMemberParameter<T> createOrgUnitMemberParameter(java.lang.String uid, java.util.Set<T> members, java.lang.Class<T> type, PageableData pageableData)
Creates the org unit member parameter.- Type Parameters:
T
- the generic type- Parameters:
uid
- the uidmembers
- the memberstype
- the typepageableData
- the pageable data- Returns:
- the org unit member parameter
-
-