-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPolicy.ts
More file actions
26 lines (21 loc) · 940 Bytes
/
Policy.ts
File metadata and controls
26 lines (21 loc) · 940 Bytes
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
import { NamedNodeAs, NamedNodeFrom, SetFrom, TermAs, TermFrom } from "@rdfjs/wrapper"
import { Matcher } from "./Matcher.js"
import { ACP } from "../vocabulary/mod.js"
import { Typed } from "./Typed.js";
export class Policy extends Typed {
get allow(): Set<string> {
return SetFrom.subjectPredicate(this, ACP.allow, NamedNodeAs.string, NamedNodeFrom.string)
}
get deny(): Set<string> {
return SetFrom.subjectPredicate(this, ACP.deny, NamedNodeAs.string, NamedNodeFrom.string)
}
get anyOf(): Set<Matcher> {
return SetFrom.subjectPredicate(this, ACP.anyOf, TermAs.instance(Matcher), TermFrom.instance)
}
get allOf(): Set<Matcher> {
return SetFrom.subjectPredicate(this, ACP.allOf, TermAs.instance(Matcher), TermFrom.instance)
}
get noneOf(): Set<Matcher> {
return SetFrom.subjectPredicate(this, ACP.noneOf, TermAs.instance(Matcher), TermFrom.instance)
}
}