Skip to content
Snippets Groups Projects
Commit ae8c9c7d authored by michael.minelli's avatar michael.minelli
Browse files

SessionManager => Add indent arg to check permissions

parent fda833db
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ class SessionAppLoginCommand extends CommanderCommand { ...@@ -41,7 +41,7 @@ class SessionAppLoginCommand extends CommanderCommand {
await SessionManager.login(options.user, options.password); await SessionManager.login(options.user, options.password);
SessionManager.checkPermissions(true); SessionManager.checkPermissions(true, 4);
} }
} }
......
...@@ -82,11 +82,11 @@ class SessionManager { ...@@ -82,11 +82,11 @@ class SessionManager {
this.token = ''; this.token = '';
} }
checkPermissions(verbose: boolean = true, ...checkPermissions: Array<string>): Permissions { checkPermissions(verbose: boolean = true, indent: number = 8, ...checkPermissions: Array<string>): Permissions {
const hasPermission = (permissionPredicate: () => boolean, verboseText: string): boolean => { const hasPermission = (permissionPredicate: () => boolean, verboseText: string): boolean => {
const spinner: ora.Ora = ora({ const spinner: ora.Ora = ora({
text : verboseText, text : verboseText,
indent: 8 indent: indent
}); });
let isAllowed: boolean = this.profile.id !== -1 && permissionPredicate(); let isAllowed: boolean = this.profile.id !== -1 && permissionPredicate();
...@@ -135,7 +135,7 @@ class SessionManager { ...@@ -135,7 +135,7 @@ class SessionManager {
return false; return false;
} }
return this.checkPermissions(verbose, ...checkPermissions); return this.checkPermissions(verbose, 8, ...checkPermissions);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment