| All Verbs | /api/permissions/{PermissionId}/matrix/ |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Get a value for the current permission and object. Including the relevant data that affects the permission value outcome.
*/
@Api(Description="Get a value for the current permission and object. Including the relevant data that affects the permission value outcome.")
public static class GetPermissionMatrix
{
/**
* Permission Id to retrieve matrix for.
*/
@ApiMember(DataType="Guid", Description="Permission Id to retrieve matrix for.", IsRequired=true, Name="PermissionId")
public UUID PermissionId = null;
/**
* Object Id to retrieve permissions for. This will be either a contact, role list item or licensee contact.
*/
@ApiMember(DataType="Guid", Description="Object Id to retrieve permissions for. This will be either a contact, role list item or licensee contact.", IsRequired=true, Name="ObjectId")
public UUID ObjectId = null;
public UUID getPermissionId() { return PermissionId; }
public GetPermissionMatrix setPermissionId(UUID value) { this.PermissionId = value; return this; }
public UUID getObjectId() { return ObjectId; }
public GetPermissionMatrix setObjectId(UUID value) { this.ObjectId = value; return this; }
}
@ApiResponse(Description="Returns the Permission Value for an object and the permission levels that make up the determination of the permission.")
public static class GetPermissionMatrixResponse
{
public Boolean PermissionLevelValue = null;
public ArrayList<PermissionLevelModel> PermissionsMatrix = null;
public ResponseStatus ResponseStatus = null;
public Boolean isPermissionLevelValue() { return PermissionLevelValue; }
public GetPermissionMatrixResponse setPermissionLevelValue(Boolean value) { this.PermissionLevelValue = value; return this; }
public ArrayList<PermissionLevelModel> getPermissionsMatrix() { return PermissionsMatrix; }
public GetPermissionMatrixResponse setPermissionsMatrix(ArrayList<PermissionLevelModel> value) { this.PermissionsMatrix = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public GetPermissionMatrixResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class PermissionLevelModel
{
public UUID PermissionValueId = null;
public UUID ObjectId = null;
public String ObjectName = null;
public String ObjectGroup = null;
public Integer ContactsAffected = null;
public Boolean PermissionValue = null;
public UUID getPermissionValueId() { return PermissionValueId; }
public PermissionLevelModel setPermissionValueId(UUID value) { this.PermissionValueId = value; return this; }
public UUID getObjectId() { return ObjectId; }
public PermissionLevelModel setObjectId(UUID value) { this.ObjectId = value; return this; }
public String getObjectName() { return ObjectName; }
public PermissionLevelModel setObjectName(String value) { this.ObjectName = value; return this; }
public String getObjectGroup() { return ObjectGroup; }
public PermissionLevelModel setObjectGroup(String value) { this.ObjectGroup = value; return this; }
public Integer getContactsAffected() { return ContactsAffected; }
public PermissionLevelModel setContactsAffected(Integer value) { this.ContactsAffected = value; return this; }
public Boolean isPermissionValue() { return PermissionValue; }
public PermissionLevelModel setPermissionValue(Boolean value) { this.PermissionValue = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/permissions/{PermissionId}/matrix/ HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"PermissionId":"00000000-0000-0000-0000-000000000000","ObjectId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"PermissionLevelValue":false,"PermissionsMatrix":[{"PermissionValueId":"00000000000000000000000000000000","ObjectId":"00000000-0000-0000-0000-000000000000","ObjectName":"String","ObjectGroup":"String","ContactsAffected":0,"PermissionValue":false}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}