Keep fixing user issues.

This commit is contained in:
Paulo Gustavo Veiga
2012-11-14 20:33:42 -03:00
parent 16e59a0879
commit 596aeeebc4
7 changed files with 11 additions and 10 deletions

View File

@@ -183,12 +183,13 @@ public class MindmapController extends BaseController {
}
final LockInfo lockInfo = lockManager.getLockInfo(mindmap);
if (lockInfo.getUser().equalCollab(user)) {
if (lockInfo.getUser().identityEquality(user)) {
final boolean outdated = mindmap.getLastModificationTime().getTimeInMillis() > timestamp;
if (lockInfo.getSession() == session) {
// Timestamp might not be returned to the client. This try to cover this case, ignoring the client timestamp check.
final User lastEditor = mindmap.getLastEditor();
if (outdated && (lockInfo.getPreviousTimestamp() != timestamp || lastEditor == null || !lastEditor.equals(user))) {
// lockInfo.getPreviousTimestamp() == timestamp : In case the timestap is not returned. Give a second chance.
if (outdated && (lockInfo.getPreviousTimestamp() != timestamp || lastEditor == null || !lastEditor.identityEquality(user))) {
throw new SessionExpiredException(lastEditor);
}
} else if (outdated) {

View File

@@ -124,7 +124,7 @@ public class RestUser {
}
RestUser restUser = (RestUser) o;
return this.getDelegated().equalCollab(restUser.getDelegated());
return this.getDelegated().identityEquality(restUser.getDelegated());
}
@Override