mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
#8771 create the Permission DTO
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user