Platform API

<back to all web services

ResetPermission

Reset a specified permission to the Perspective default or reset all permissions.

Requires Authentication
The following routes are available for this service:
All Verbs/api/permissions/{PermissionId}/reset
All Verbs/api/permissions/reset
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


// @ApiResponse(Description="Returns a response status indicating success or not.")
class ResetPermissionResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Reset a specified permission to the Perspective default or reset all permissions. */
// @Api(Description="Reset a specified permission to the Perspective default or reset all permissions.")
class ResetPermission implements JsonSerializable
{
    public function __construct(
        /** @description Set the permissionId if you wish to reset a selected permission. Leaving this blank will reset all permissions. */
        // @ApiMember(DataType="Guid", Description="Set the permissionId if you wish to reset a selected permission. Leaving this blank will reset all permissions.", Name="PermissionId")
        /** @var string */
        public string $PermissionId='',

        /** @description If this is true then permissions for a licensee will be updated to match those for 'Perspective', adding new missing values where necessary (this includes removing any new permission values added by the licensee that 'Perspective' does not have a setting for). If this is false, then values for the licensee will not get updated, however any missing permission values will get created to match the 'Perspective' value.  */
        // @ApiMember(DataType="bool", Description="If this is true then permissions for a licensee will be updated to match those for 'Perspective', adding new missing values where necessary (this includes removing any new permission values added by the licensee that 'Perspective' does not have a setting for). If this is false, then values for the licensee will not get updated, however any missing permission values will get created to match the 'Perspective' value. ", Name="Reinitialise")
        /** @var bool|null */
        public ?bool $Reinitialise=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PermissionId'])) $this->PermissionId = $o['PermissionId'];
        if (isset($o['Reinitialise'])) $this->Reinitialise = $o['Reinitialise'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PermissionId)) $o['PermissionId'] = $this->PermissionId;
        if (isset($this->Reinitialise)) $o['Reinitialise'] = $this->Reinitialise;
        return empty($o) ? new class(){} : $o;
    }
}

PHP ResetPermission DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/permissions/{PermissionId}/reset HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"PermissionId":"00000000-0000-0000-0000-000000000000","Reinitialise":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}