File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11import { Authorisation } from "./auth/Authorisation.js" ;
2+ import { Permissible } from "./auth/Permissible.js" ;
23import { Request } from "./Request.js" ;
34
4- export class AuthenticatedRequest < A > extends Request < A > {
5+ export class AuthenticatedRequest < A > extends Request < A > implements Permissible {
56 public readonly authorisation : Authorisation < A > ;
67 public constructor (
78 authorisation : Authorisation < A > ,
@@ -10,4 +11,12 @@ export class AuthenticatedRequest<A> extends Request<A> {
1011 super ( ...args ) ;
1112 this . authorisation = authorisation ;
1213 }
14+
15+ /**
16+ * Check if the request has the specified permission.
17+ * @param permission
18+ */
19+ public has ( permission : Permission ) : boolean {
20+ return this . authorisation . has ( permission ) ;
21+ }
1322}
You can’t perform that action at this time.
0 commit comments