1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.astrogrid.community.client.policy.service ;
22
23 import org.astrogrid.community.common.policy.data.PolicyPermission ;
24 import org.astrogrid.community.common.policy.data.PolicyCredentials ;
25
26 import org.astrogrid.community.client.service.CommunityServiceDelegate ;
27
28 import org.astrogrid.community.common.exception.CommunityPolicyException ;
29 import org.astrogrid.community.common.exception.CommunityServiceException ;
30 import org.astrogrid.community.common.exception.CommunityIdentifierException ;
31
32 /***
33 * Interface for our PolicyService delegate.
34 * This mirrors the PolicyService interface, without the RemoteExceptions.
35 *
36 */
37 public interface PolicyServiceDelegate
38 extends CommunityServiceDelegate
39 {
40
41 /***
42 * Confirm permissions.
43 * @param credentials The credentials, containing the account and group identifiers.
44 * @param resource The resource identifier.
45 * @param action The action you want to perform.
46 * @return A PolicyPermission object confirming the permission.
47 * @throws CommunityIdentifierException If one of the identifiers is invalid.
48 * @throws CommunityPolicyException If there is no matching permission.
49 * @throws CommunityServiceException If there is an internal error in the service.
50 *
51 */
52 public PolicyPermission checkPermissions(PolicyCredentials credentials, String resource, String action)
53 throws CommunityServiceException, CommunityPolicyException, CommunityIdentifierException ;
54
55 /***
56 * Confirm membership.
57 * @param credentials The credentials, containing the account and group identifiers.
58 * @return A PolicyCredentials object confirming the membership.
59 * @throws CommunityIdentifierException If one of the identifiers is invalid.
60 * @throws CommunityPolicyException If there is no matching permission.
61 * @throws CommunityServiceException If there is an internal error in the service.
62 *
63 */
64 public PolicyCredentials checkMembership(PolicyCredentials credentials)
65 throws CommunityServiceException, CommunityPolicyException, CommunityIdentifierException ;
66
67 }