@@ -10,11 +10,11 @@ import { PermissionTarget } from '../enums/PermissionTargets';
|
||||
import { ResponsePrincipal } from './ResponsePrincipal';
|
||||
|
||||
/**
|
||||
* Defines a track of given length.
|
||||
* Defines the permission response.
|
||||
*/
|
||||
export class ResponsePermission {
|
||||
/**
|
||||
* Autogenerated unique id (primary key).
|
||||
* The permission's id.
|
||||
*/
|
||||
@IsInt()
|
||||
id: number;;
|
||||
@@ -40,6 +40,10 @@ export class ResponsePermission {
|
||||
@IsEnum(PermissionAction)
|
||||
action: PermissionAction;
|
||||
|
||||
/**
|
||||
* Creates a ResponsePermission object from a permission.
|
||||
* @param permission The permission the response shall be build for.
|
||||
*/
|
||||
public constructor(permission: Permission) {
|
||||
this.id = permission.id;
|
||||
this.principal = permission.principal.toResponse();
|
||||
|
||||
Reference in New Issue
Block a user