DS-3346 change and remove deprecated setIgnoreAuthorization in favour of turnOff/restore

This commit is contained in:
Luigi Andrea Pascarelli
2016-09-28 23:39:24 +02:00
parent ebeda8cc29
commit f577074e69
21 changed files with 32 additions and 47 deletions

View File

@@ -309,11 +309,11 @@ public class LDAPAuthentication
{
log.info(LogManager.getHeader(context,
"type=ldap-login", "type=ldap_but_already_email"));
context.setIgnoreAuthorization(true);
context.turnOffAuthorisationSystem();
eperson.setNetid(netid.toLowerCase());
ePersonService.update(context, eperson);
context.dispatchEvents();
context.setIgnoreAuthorization(false);
context.restoreAuthSystemState();
context.setCurrentUser(eperson);
// assign user to groups based on ldap dn
@@ -328,7 +328,7 @@ public class LDAPAuthentication
// TEMPORARILY turn off authorisation
try
{
context.setIgnoreAuthorization(true);
context.turnOffAuthorisationSystem();
eperson = ePersonService.create(context);
if (StringUtils.isNotEmpty(email))
{
@@ -362,7 +362,7 @@ public class LDAPAuthentication
}
finally
{
context.setIgnoreAuthorization(false);
context.restoreAuthSystemState();
}
log.info(LogManager.getHeader(context, "authenticate",
@@ -384,7 +384,7 @@ public class LDAPAuthentication
}
finally
{
context.setIgnoreAuthorization(false);
context.restoreAuthSystemState();
}
}
}