Class PermissionUtils
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.policy.PermissionUtils
-
public final class PermissionUtils extends Object
Convenience methods used for processing permissions and authorities
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPermissionUtils.PermissionType
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<String>getPermissionRoot(String permission)Obtains the 'root' of the permission which is defined as anything that comes after one of thePermissionUtils.PermissionType.prefixes().
-
-
-
Method Detail
-
getPermissionRoot
public static Optional<String> getPermissionRoot(@NonNull String permission)
Obtains the 'root' of the permission which is defined as anything that comes after one of thePermissionUtils.PermissionType.prefixes(). Example: given ALL_PRODUCT this will return PRODUCT and given SOME_PERMISSION this will return an empty optional- Parameters:
permission- a permission- Returns:
- the root of permission or an empty Optional if permission does not
start with
PermissionUtils.PermissionType.prefixes() - See Also:
PermissionUtils.PermissionType.prefixes()
-
-