mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
providing update feature for additional User properties in SecurityService and UserManagementService
Change-Id: I46a4c2c58e35595dc20b85575a27c1cfbd639592
This commit is contained in:
1 parent
fb3f74d297
commit
4e0c3f7073
6 files changed
+42
-1
No files matched your search
+2
@@ -31,6 +31,8 @@ public interface UserManagementService extends RemoteService {
|
||||
|
||||
void updateSimpleUserEmail(String username, String newEmail, String validationBaseURL) throws UserManagementException, MailException;
|
||||
|
||||
void updateUserProperties(String username, String fullName, String company) throws UserManagementException;
|
||||
|
||||
void resetPassword(String username, String eMailAddress, String baseURL) throws UserManagementException, MailException;
|
||||
|
||||
boolean validateEmail(String username, String validationSecret) throws UserManagementException;
|
||||
|
||||
+2
@@ -27,6 +27,8 @@ public interface UserManagementServiceAsync {
|
||||
|
||||
void updateSimpleUserEmail(String username, String newEmail, String validationBaseURL, AsyncCallback<Void> callback);
|
||||
|
||||
void updateUserProperties(String username, String fullName, String company, AsyncCallback<Void> callback);
|
||||
|
||||
void getFilteredSortedUserList(String filter, AsyncCallback<Collection<UserDTO>> callback);
|
||||
|
||||
void setRolesForUser(String username, Iterable<String> roles, AsyncCallback<SuccessInfo> callback);
|
||||
|
||||
+11
@@ -163,6 +163,17 @@ public class UserManagementServiceImpl extends RemoteServiceServlet implements U
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserProperties(final String username, String fullName, String company) throws UserManagementException {
|
||||
final Subject subject = SecurityUtils.getSubject();
|
||||
// the signed-in subject has role ADMIN or is changing own user
|
||||
if (subject.hasRole(DefaultRoles.ADMIN.getRolename()) || username.equals(subject.getPrincipal().toString())) {
|
||||
getSecurityService().updateUserProperties(username, fullName, company);
|
||||
} else {
|
||||
throw new UserManagementException(UserManagementException.INVALID_CREDENTIALS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSimpleUserEmail(String username, String newEmail, String validationBaseURL) throws UserManagementException, MailException {
|
||||
final Subject subject = SecurityUtils.getSubject();
|
||||
|
||||
Reference in new issue
Block a user