1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services.security;
18
19 import java.util.Iterator;
20
21 import org.apache.jetspeed.om.security.Group;
22 import org.apache.jetspeed.om.security.Permission;
23 import org.apache.jetspeed.om.security.Role;
24 import org.apache.turbine.services.Service;
25
26 /***
27 * The Security Cache Service caches roles and permissions (ACLs)
28 *
29 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
30 * @version $Id: SecurityCacheService.java,v 1.8 2004/02/23 03:58:11 jford Exp $
31 */
32
33
34 public interface SecurityCacheService extends Service
35 {
36 /*** The name of this service */
37 public String SERVICE_NAME = "SecurityCache";
38
39
40
41
42
43
44 public void load(String username)
45 throws JetspeedSecurityException;
46
47
48
49
50
51
52 public void unload(String username);
53
54
55 public void loadRolePermissions();
56
57 /***
58 * Retrieves a role from the cache for the given username.
59 *
60 * @param username The name key of the user.
61 * @param roleName The name of the role.
62 */
63 public Role getRole(String username, String roleName);
64
65 public Role getRole(String username, String roleName, String groupName);
66
67 /***
68 * Retrieves a role from the cache for the given username.
69 *
70 */
71 public void addRole(Role role);
72
73 public void addRole(String username, Role role);
74
75 public void addRole(String username, Role role, Group group);
76
77 public boolean hasRole(String username, String roleName);
78
79 public boolean hasRole(String username, String roleName, String groupName);
80
81 public void removeRole(String username, String roleName);
82
83 public void removeRole(String username, String roleName, String groupName);
84
85 public Iterator getRoles(String username);
86
87 public CachedAcl getAcl(String username);
88
89 public Permission getPermission(String roleName, String permissionName);
90
91 public void addPermission(String roleName, Permission permission);
92
93 public boolean hasPermission(String roleName, String permissionName);
94
95 public void removePermission(String roleName, String permissionName);
96
97 public Iterator getPermissions(String roleName);
98
99 public void removeAllRoles(String rolename);
100
101 public void removeAllPermissions(String permissionName);
102
103 }
104
105
106