AccessControlEntry.java
1.49 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Decompiled with CFR 0_118.
*/
package com.day.cq.wcm.msm.impl.actions.util;
import java.util.Arrays;
public class AccessControlEntry {
private final String principalName;
private final String[] privilegeNames;
private final boolean isAllow;
private final String restrictionPattern;
public /* varargs */ AccessControlEntry(String principal, boolean allow, String restrictionPattern, String ... privilegeNames) {
this.principalName = principal;
this.privilegeNames = privilegeNames;
this.isAllow = allow;
this.restrictionPattern = restrictionPattern;
}
public AccessControlEntry(String newPrincipal, AccessControlEntry templateACE) {
this(newPrincipal, templateACE.isAllow(), templateACE.getRestrictionPattern(), templateACE.getPrivilegeNames());
}
public String getPrincipalName() {
return this.principalName;
}
public String[] getPrivilegeNames() {
return this.privilegeNames;
}
public boolean isAllow() {
return this.isAllow;
}
public String getRestrictionPattern() {
return this.restrictionPattern;
}
public String toString() {
Object[] arrobject = new Object[4];
arrobject[0] = this.principalName;
arrobject[1] = this.isAllow() ? "allows" : "denies";
arrobject[2] = this.getRestrictionPattern();
arrobject[3] = Arrays.toString(this.getPrivilegeNames());
return String.format("ACE for %s %s %s %s", arrobject);
}
}