01: /*
02: * Copyright 20052006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: *
13: * @created Mar 9, 2006
14: * @author Marc Batchelor
15: */
16:
17: package com.pentaho.security;
18:
19: import org.acegisecurity.GrantedAuthority;
20:
21: public interface UserRoleListService {
22:
23: /**
24: * Returns all authorities known to the provider. Cannot return
25: * <code>null</code>
26: * @return the authorities (never <code>null</code>)
27: */
28: public GrantedAuthority[] getAllAuthorities();
29:
30: /**
31: * Returns all user names known to the provider. Cannot return
32: * <code>null</code>
33: * @return the users (never <code>null</code>)
34: */
35: public String[] getAllUsernames();
36:
37: /**
38: * Returns all known users in the specified role. Cannot return
39: * <code>null</code>
40: * @param authority The authority to look users up by. Cannot be <code>null</code>
41: * @return the users. (never <code>null</code>)
42: */
43: public String[] getUsernamesInRole(GrantedAuthority authority);
44:
45: /**
46: * Returns all authorities granted for a specified user.
47: * @param username The name of the user to look up authorities for
48: * @return the authorities. (Never <code>null</code>)
49: */
50: public GrantedAuthority[] getAuthoritiesForUser(String username);
51:
52: }
|