Commit 17db3ff2 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

User can't generate FTP password

parent 4a5b3fe6
......@@ -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