Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed some serialization issues for GetProjectSharingSettingsResult a… #18

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.stanford.protege.webprotege.sharing;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.*;
import edu.stanford.protege.webprotege.dispatch.Result;

import static com.google.common.base.Preconditions.checkNotNull;
Expand All @@ -11,7 +11,7 @@
* 07/02/15
*/
@JsonTypeName("webprotege.projects.GetProjectSharingSettings")
public record GetProjectSharingSettingsResult(ProjectSharingSettings settings) implements Result {
public record GetProjectSharingSettingsResult(@JsonProperty("settings") ProjectSharingSettings settings) implements Result {

public GetProjectSharingSettingsResult(ProjectSharingSettings settings) {
this.settings = checkNotNull(settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ProjectSharingSettings implements Serializable {
private final List<SharingSetting> sharingSettings = new ArrayList<>();

@Nullable
private SharingPermission linkSharingPermission = null;
private final SharingPermission linkSharingPermission;

@JsonCreator
public ProjectSharingSettings(@JsonProperty("projectId") ProjectId projectId,
Expand All @@ -38,14 +38,17 @@ public ProjectSharingSettings(@JsonProperty("projectId") ProjectId projectId,
this.linkSharingPermission = checkNotNull(linkSharingPermission).orElse(null);
}

@JsonProperty("projectId")
public ProjectId getProjectId() {
return projectId;
}

@JsonProperty("sharingSettings")
public List<SharingSetting> getSharingSettings() {
return new ArrayList<>(sharingSettings);
}

@JsonProperty("linkSharingPermission")
public Optional<SharingPermission> getLinkSharingPermission() {
return Optional.ofNullable(linkSharingPermission);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public enum SharingPermission implements Serializable {
*/
EDIT,

ICD_EDIT,

/**
* A user can manage a project
*/
Expand Down
Loading