]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.security.core/src/org/argeo/security/UserAdminService.java
Introduce bundle context callback
[lgpl/argeo-commons.git] / org.argeo.security.core / src / org / argeo / security / UserAdminService.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.argeo.security;
17
18 import java.util.Set;
19
20 import org.springframework.security.provisioning.UserDetailsManager;
21
22 /** Enrich {@link UserDetailsManager} in order to provide roles semantics. */
23 public interface UserAdminService extends UserDetailsManager {
24 /**
25 * Usernames must match this regexp pattern ({@value #USERNAME_PATTERN}).
26 * Thanks to <a href=
27 * "http://www.mkyong.com/regular-expressions/how-to-validate-username-with-regular-expression/"
28 * >this tip</a> (modified to add upper-case, add '@')
29 */
30 //public final static String USERNAME_PATTERN = "^[a-zA-Z0-9_-@]{3,64}$";
31
32 /**
33 * Email addresses must match this regexp pattern ({@value #EMAIL_PATTERN}.
34 * Thanks to <a href=
35 * "http://www.mkyong.com/regular-expressions/how-to-validate-email-address-with-regular-expression/"
36 * >this tip</a>.
37 */
38 public final static String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
39
40 /*
41 * USERS
42 */
43 /** List all users. */
44 public Set<String> listUsers();
45
46 /** List users having this role (except the super user). */
47 public Set<String> listUsersInRole(String role);
48
49 /** Synchronize with the underlying DAO. */
50 public void synchronize();
51
52 /*
53 * ROLES
54 */
55 public void newRole(String role);
56
57 public Set<String> listEditableRoles();
58
59 public void deleteRole(String role);
60 }