feat: authorize CloudLink access

This commit is contained in:
Baptiste Grob
2021-03-11 15:41:29 +01:00
parent 93f8d6bbe7
commit 59dbbcf6fd
3 changed files with 16 additions and 9 deletions

View File

@@ -204,10 +204,17 @@ export class WebApplication extends SNApplication {
}
async openModalComponent(component: SNComponent): Promise<void> {
if (component.package_info?.identifier === "org.standardnotes.batch-manager") {
if (!await this.authorizeBatchManagerAccess()) {
return;
}
switch (component.package_info?.identifier) {
case 'org.standardnotes.batch-manager':
if (!await this.authorizeBatchManagerAccess()) {
return;
}
break;
case 'org.standardnotes.cloudlink':
if (!await this.authorizeCloudLinkAccess()) {
return;
}
break;
}
const scope = this.scope!.$new(true) as Partial<ComponentModalScope>;
scope.componentUuid = component.uuid;