Class PreferenceWorker
java.lang.Object
org.apache.ofbiz.common.preferences.PreferenceWorker
User preference worker methods.
-
Method Summary
Modifier and TypeMethodDescriptioncheckCopyPermission
(DispatchContext ctx, Map<String, ?> context) Checks preference copy permissions.checkPermission
(DispatchContext ctx, Map<String, ?> context) Checks preference get/set permissions.toFieldMap
(String userLoginId, String userPrefTypeId, String userPrefGroupTypeId, Object userPrefValue) Creates a field Map to be used in GenericValue create or store methods.
-
Method Details
-
checkCopyPermission
Checks preference copy permissions. Returns hasPermission=true if permission is granted.Users can copy from any set of preferences to their own preferences. Copying to another user's preferences requires ADMIN_PERMISSION permission.
- Parameters:
ctx
- The DispatchContext that this service is operating in.context
- Map containing the input arguments.- Returns:
- Map with the result of the service, the output parameters.
-
checkPermission
Checks preference get/set permissions. Returns hasPermission=true if permission is granted.This method is a simple wrapper around the isValidxxxId methods.
- Parameters:
ctx
- The DispatchContext that this service is operating in.context
- Map containing the input arguments.- Returns:
- Map with the result of the service, the output parameters.
-
toFieldMap
public static Map<String,Object> toFieldMap(String userLoginId, String userPrefTypeId, String userPrefGroupTypeId, Object userPrefValue) throws GeneralException Creates a field Map to be used in GenericValue create or store methods.- Parameters:
userLoginId
- The user's login IDuserPrefTypeId
- The preference IDuserPrefGroupTypeId
- The preference group ID (may be null or empty)userPrefValue
- The preference value (will be converted to java.lang.String data type)- Returns:
- field map
- Throws:
GeneralException
-