Package com.atlassian.jira.sharing
Class SharePermissionUtils
java.lang.Object
com.atlassian.jira.sharing.SharePermissionUtils
Some utility functions for dealing with
SharePermission instances.
TODO move to UI package
- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUtility functions for dealing withShareRightinstances. -
Method Summary
Modifier and TypeMethodDescriptionfromJsonArray(JSONArray array) Convert the passed array into SharePermissions.fromJsonArrayString(String jsonString) static SharePermissionfromJsonObject(JSONObject json) Return a SharePermission from a JSON object.static SharePermissionfromJsonObjectString(String jsonString) Create a SharePermission from the passed JSON string.static JSONObjectgetShareRightsJson(ShareRight shareRight) static JSONObjecttoJson(SharePermission permission) Convert the passed permission into a JSON object.static JSONArraytoJsonArray(Collection<SharePermission> permissions) Converts the passed SharePermissions into a JSON array.
-
Method Details
-
toJsonArray
Converts the passed SharePermissions into a JSON array.- Parameters:
permissions- the permissions to convert.- Returns:
- the JSON array.
- Throws:
JSONException- if an error occurs while creating the JSONArray.
-
fromJsonObject
Return a SharePermission from a JSON object.- Parameters:
json- the JSON object to convert.- Returns:
- the converted SharePermission.
- Throws:
JSONException- if an error occurs while converting the object.
-
fromJsonObjectString
Create a SharePermission from the passed JSON string.- Parameters:
jsonString- the JSON string make a SharePermission from.- Returns:
- the new SharePermission.
- Throws:
JSONException- if an error occurs while converting the object.
-
fromJsonArray
Convert the passed array into SharePermissions.- Parameters:
array- the JSON array to convert.- Returns:
- the converted SharePermission.
- Throws:
JSONException- if an error occurs during convertion.
-
fromJsonArrayString
public static SharedEntity.SharePermissions fromJsonArrayString(String jsonString) throws JSONException - Throws:
JSONException