]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/CmsUserManager.java
d970855ff5066316857c38b101c52f4d43767e2d
3 import java
.time
.ZonedDateTime
;
7 import javax
.security
.auth
.Subject
;
8 import javax
.transaction
.UserTransaction
;
10 import org
.osgi
.framework
.InvalidSyntaxException
;
11 import org
.osgi
.service
.useradmin
.Role
;
12 import org
.osgi
.service
.useradmin
.User
;
13 import org
.osgi
.service
.useradmin
.UserAdmin
;
16 * Provide method interfaces to manage user concepts without accessing directly
19 public interface CmsUserManager
{
22 /** Returns the e-mail of the current logged in user */
23 public String
getMyMail();
26 /** Returns a {@link User} given a username */
27 public User
getUser(String username
);
29 /** Can be a group or a user */
30 public String
getUserDisplayName(String dn
);
32 /** Can be a group or a user */
33 public String
getUserMail(String dn
);
35 /** Lists all roles of the given user */
36 public String
[] getUserRoles(String dn
);
38 /** Checks if the passed user belongs to the passed role */
39 public boolean isUserInRole(String userDn
, String roleDn
);
42 /** Returns a filtered list of roles */
43 public Role
[] getRoles(String filter
) throws InvalidSyntaxException
;
45 /** Recursively lists users in a given group. */
46 public Set
<User
> listUsersInGroup(String groupDn
, String filter
);
48 /** Search among groups including system roles and users if needed */
49 public List
<User
> listGroups(String filter
, boolean includeUsers
, boolean includeSystemRoles
);
52 /** Returns the dn of a role given its local ID */
53 public String
buildDefaultDN(String localId
, int type
);
55 /** Exposes the main default domain name for this instance */
56 public String
getDefaultDomainName();
59 * Search for a {@link User} (might also be a group) whose uid or cn is equals
60 * to localId within the various user repositories defined in the current
63 public User
getUserFromLocalId(String localId
);
65 void changeOwnPassword(char[] oldPassword
, char[] newPassword
);
67 void resetPassword(String username
, char[] newPassword
);
70 String
addSharedSecret(String username
, int hours
);
72 // String addSharedSecret(String username, String authInfo, String authToken);
74 void addAuthToken(String userDn
, String token
, Integer hours
, String
... roles
);
76 void addAuthToken(String userDn
, String token
, ZonedDateTime expiryDate
, String
... roles
);
78 void expireAuthToken(String token
);
80 void expireAuthTokens(Subject subject
);
82 // User createUserFromPerson(Node person);
85 public UserAdmin
getUserAdmin();
88 public UserTransaction
getUserTransaction();