Commit d2230251 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '183-user-can-t-generate-ftp-password' into 'master'

User can't generate FTP password

Closes #183

See merge request genesys-pgr/genesys-server!95
parents 4a5b3fe6 58864c69
......@@ -46,7 +46,7 @@ public interface UserService extends BasicUserService<UserRole, User> {
UserWrapper getWrappedById(long userId) throws UserException;
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.user.id == #userId")
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.id == #userId")
User updateData(long userId, String name, String email) throws UserException;
User getSystemUser(String string);
......
......@@ -189,7 +189,7 @@ public class UserServiceImpl extends BasicUserServiceImpl<UserRole, User> implem
}
@Override
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.user.id == #userId")
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.id == #userId")
@Transactional(readOnly = false, rollbackFor = NotUniqueUserException.class)
public User updateData(long userId, String name, String email) throws UserException {
final User user = userRepository.findOne(userId);
......@@ -390,7 +390,7 @@ public class UserServiceImpl extends BasicUserServiceImpl<UserRole, User> implem
*/
@Override
@Transactional
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.user.id == #user.id")
@PreAuthorize("hasRole('ADMINISTRATOR') || (hasRole('VETTEDUSER') && principal.id == #user.id)")
public void setFtpPassword(final User user, final String ftpPassword) throws PasswordPolicyException {
assureGoodPassword(ftpPassword);
user.setFtpPassword(passwordEncoder.encode(ftpPassword));
......
......@@ -58,14 +58,14 @@
<c:if test="${user.ftpPassword ne null}">
<div class="form-group" id="ftp-credentials">
<label class="col-lg-2 control-label"><spring:message code="userprofile.page.ftp-credentials" /></label>
<div class="col-lg-5 form-control-static">
<div class="col-lg-5">
<div>
<label for="ftp-username"><spring:message code="login.username" /></label>
<span id="ftp-username"><c:out value="${user.email}" /></span>
<label for="ftp-username" class="control-label"><spring:message code="login.username" /></label>
<span id="ftp-username" class="form-control-static"><c:out value="${user.email}" /></span>
</div>
<div>
<label for="ftp-password"><spring:message code="login.password" /></label>
<span id="ftp-password">*</span>
<label for="ftp-password" class="control-label"><spring:message code="login.password" /></label>
<span id="ftp-password" class="form-control-static">*</span>
</div>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment