Class OrgUtils
- java.lang.Object
-
- de.hybris.platform.commerceservices.organization.utils.OrgUtils
-
public final class OrgUtils extends java.lang.ObjectOrganization utils class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontainsOrgAdminGroup(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 booleanisAdmin(EmployeeModel employee)Checks whether the given employee is the admin of an organizational unit.protected static booleanisAdminRole(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:
trueif the employee is an admin,falseotherwise
-
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:
trueif the collection contains an admin group,falseotherwise
-
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
-
-