1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.crypto.script.internal; |
21 |
|
|
22 |
|
import java.nio.charset.Charset; |
23 |
|
|
24 |
|
import org.xwiki.crypto.store.StoreReference; |
25 |
|
import org.xwiki.crypto.store.WikiStoreReference; |
26 |
|
import org.xwiki.security.authorization.AccessDeniedException; |
27 |
|
import org.xwiki.security.authorization.ContextualAuthorizationManager; |
28 |
|
import org.xwiki.security.authorization.Right; |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
@version |
34 |
|
@since |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
36 |
|
public abstract class AbstractScriptingStore |
37 |
|
{ |
38 |
|
protected static final Charset UTF8 = Charset.forName("UTF-8"); |
39 |
|
|
40 |
|
protected StoreReference storeReference; |
41 |
|
|
42 |
|
private ContextualAuthorizationManager contextualAuthorizationManager; |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
44 |
0 |
protected AbstractScriptingStore(StoreReference reference,... |
45 |
|
ContextualAuthorizationManager contextualAuthorizationManager) |
46 |
|
{ |
47 |
0 |
this.storeReference = reference; |
48 |
0 |
this.contextualAuthorizationManager = contextualAuthorizationManager; |
49 |
|
} |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
51 |
0 |
protected void checkAccess(Right right) throws AccessDeniedException... |
52 |
|
{ |
53 |
0 |
if (storeReference instanceof WikiStoreReference) { |
54 |
0 |
contextualAuthorizationManager.checkAccess(right, ((WikiStoreReference) storeReference).getReference()); |
55 |
|
} else { |
56 |
0 |
contextualAuthorizationManager.checkAccess(Right.PROGRAM); |
57 |
|
} |
58 |
|
} |
59 |
|
} |