All files / src/abap/2_statements/statements get_permissions.ts

100% Statements 35/35
100% Branches 1/1
100% Functions 1/1
100% Lines 35/35

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x  
import {IStatement} from "./_statement";
import {alt, altPrio, opt, optPrio, per, plus, seq, ver, AlsoIn} from "../combi";
import {Dynamic, EntityAssociation, NamespaceSimpleName, Source, Target} from "../expressions";
import {IStatementRunnable} from "../statement_runnable";
import {Release} from "../../../version";
 
export class GetPermissions implements IStatement {
 
  public getMatcher(): IStatementRunnable {
    const aspect = altPrio("FEATURES", "AUTHORIZATION");
    const only = seq("ONLY", altPrio(
      seq("GLOBAL", optPrio(aspect)),
      seq("INSTANCE", optPrio(aspect)),
      aspect,
      Dynamic));
 
    const query = seq("ENTITY", alt(NamespaceSimpleName, EntityAssociation),
                      optPrio(seq("FROM", Source)),
                      "REQUEST", Source,
                      "RESULT", Target);
 
    const long = seq("OF", NamespaceSimpleName, plus(query));
    const operations = seq("OPERATIONS", Source);
 
    const response = optPrio(per(seq("FAILED", Target), seq("REPORTED", Target)));
 
    const s = seq("GET PERMISSIONS",
                  optPrio(seq(opt("FORWARDING"), "PRIVILEGED")),
                  optPrio(only),
                  altPrio(long, operations, query),
                  response);
    return ver(Release.v754, s, {also: AlsoIn.OpenABAP});
  }
 
}