mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
18 lines
582 B
TypeScript
18 lines
582 B
TypeScript
import { UnsupportedHttpError } from '../util/errors/UnsupportedHttpError';
|
|
import { Authorizer, AuthorizerArgs } from './Authorizer';
|
|
|
|
/**
|
|
* Authorizer which allows all access independent of the identifier and requested permissions.
|
|
*/
|
|
export class SimpleAuthorizer extends Authorizer {
|
|
public async canHandle(input: AuthorizerArgs): Promise<void> {
|
|
if (!input.identifier || !input.permissions) {
|
|
throw new UnsupportedHttpError('Authorizer requires an identifier and permissions.');
|
|
}
|
|
}
|
|
|
|
public async handle(): Promise<void> {
|
|
// Allows all actions
|
|
}
|
|
}
|