Auth for everything (and everything auth) #6 #35

Merged
philipp merged 39 commits from feature/6-api_auth into dev 2020-12-18 21:53:18 +00:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit 445e96dcdf - Show all commits

View File

@ -36,4 +36,11 @@ export class Permission {
*/ */
@Column({ type: 'varchar' }) @Column({ type: 'varchar' })
action: PermissionAction; action: PermissionAction;
/**
* Turn this into a string for exporting (and jwts).
*/
public toString(): string {
return this.target + ":" + this.action;
}
} }

View File

@ -129,6 +129,9 @@ export class User extends Principal {
return final_permissions return final_permissions
} }
/**
* Turn this into a response.
*/
public toResponse(): ResponsePrincipal { public toResponse(): ResponsePrincipal {
return new ResponseUser(this); return new ResponseUser(this);
} }