]> git.argeo.org Git - lgpl/argeo-commons.git/blob - UserAdminService.java
65bc4bb251eb2dba8afe374aa7a3baac656bb818
[lgpl/argeo-commons.git] / UserAdminService.java
1 package org.argeo.security;
2
3 import java.util.Set;
4
5 import org.springframework.security.userdetails.UserDetailsManager;
6
7 /** Enrich {@link UserDetailsManager} in order to provide roles semantics. */
8 public interface UserAdminService extends UserDetailsManager {
9 /**
10 * Usernames must match this regexp pattern ({@value #USERNAME_PATTERN}).
11 * Thanks to <a href=
12 * "http://www.mkyong.com/regular-expressions/how-to-validate-username-with-regular-expression/"
13 * >this tip</a> (modified to add upper-case, add '@')
14 */
15 //public final static String USERNAME_PATTERN = "^[a-zA-Z0-9_-@]{3,64}$";
16
17 /**
18 * Email addresses must match this regexp pattern ({@value #EMAIL_PATTERN}.
19 * Thanks to <a href=
20 * "http://www.mkyong.com/regular-expressions/how-to-validate-email-address-with-regular-expression/"
21 * >this tip</a>.
22 */
23 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,})$";
24
25 /*
26 * USERS
27 */
28 /** List all users. */
29 public Set<String> listUsers();
30
31 /** List users having this role (except the super user). */
32 public Set<String> listUsersInRole(String role);
33
34 /** Synchronize with the underlying DAO. */
35 public void synchronize();
36
37 /*
38 * ROLES
39 */
40 public void newRole(String role);
41
42 public Set<String> listEditableRoles();
43
44 public void deleteRole(String role);
45 }