#8771 create the Permission DTO

This commit is contained in:
Mohamed Karray
2018-08-14 16:44:42 +02:00
parent 8c541b8dec
commit 012ac34a6a
3 changed files with 85 additions and 48 deletions

View File

@@ -0,0 +1,26 @@
package sonia.scm.api.v2.resources;
import com.fasterxml.jackson.annotation.JsonInclude;
import de.otto.edison.hal.HalRepresentation;
import de.otto.edison.hal.Links;
import lombok.Getter;
import lombok.Setter;
@Getter @Setter
public class PermissionDto extends HalRepresentation {
@JsonInclude(JsonInclude.Include.NON_NULL)
private PermissionTypeDto type = PermissionTypeDto.READ;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String name;
private boolean groupPermission = false;
@Override
@SuppressWarnings("squid:S1185") // We want to have this method available in this package
protected HalRepresentation add(Links links) {
return super.add(links);
}
}

View File

@@ -0,0 +1,26 @@
package sonia.scm.api.v2.resources;
/**
* Type of permissionPrefix for a {@link RepositoryDto}.
*
* @author mkarray
*/
public enum PermissionTypeDto {
/**
* read permission
*/
READ,
/**
* read and write permission
*/
WRITE,
/**
* read, write and manage the properties and permissions
*/
OWNER
}