Commit 20b9753d authored by Daniel Gerhardt's avatar Daniel Gerhardt

Remove obsolete session creator anonymization

It is no longer necessary since the creator property is not serialized
for the API.
parent 951457c9
......@@ -55,43 +55,6 @@ public class Session implements Entity {
private boolean feedbackLock;
private boolean flipFlashcards;
/**
* Returns a copy of the given session without any information that identifies a person.
* @param original The session to create a anonymized copy of
* @return The anonymized copy of the session
*/
public static Session anonymizedCopy(final Session original) {
final Session copy = new Session();
copy.name = original.name;
copy.shortName = original.shortName;
copy.keyword = original.keyword;
copy.creator = ""; // anonymous
copy.active = original.active;
copy.lastOwnerActivity = original.lastOwnerActivity;
copy.courseType = original.courseType;
copy.courseId = original.courseId;
copy.creationTime = original.creationTime;
copy.learningProgressOptions = new ScoreOptions(original.learningProgressOptions);
copy.features = new SessionFeature(original.features);
// public pool
copy.ppAuthorName = original.ppAuthorName;
copy.ppAuthorMail = original.ppAuthorMail;
copy.ppUniversity = original.ppUniversity;
copy.ppLogo = original.ppLogo;
copy.ppSubject = original.ppSubject;
copy.ppLicense = original.ppLicense;
copy.ppDescription = original.ppDescription;
copy.ppFaculty = original.ppFaculty;
copy.ppLevel = original.ppLevel;
copy.sessionType = original.sessionType;
copy.feedbackLock = original.feedbackLock;
copy.flipFlashcards = original.flipFlashcards;
copy.id = original.id;
copy.rev = original.rev;
return copy;
}
@JsonView({View.Persistence.class, View.Public.class})
public String getId() {
return id;
......
......@@ -259,7 +259,7 @@ public class SessionServiceImpl extends EntityService<Session> implements Sessio
@PreAuthorize("isAuthenticated()")
public Session getByKey(final String keyword) {
final User user = userService.getCurrentUser();
return Session.anonymizedCopy(this.getInternal(keyword, user));
return this.getInternal(keyword, user);
}
@PreAuthorize("isAuthenticated() and hasPermission(#sessionkey, 'session', 'owner')")
......
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