Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
feat(group): manage group permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGeraud committed Oct 17, 2016
1 parent e147ef6 commit 67b2ff3
Show file tree
Hide file tree
Showing 48 changed files with 2,355 additions and 365 deletions.
Expand Up @@ -27,7 +27,9 @@
import java.util.*;

/**
* @author David BRASSELY (brasseld at gmail.com)
* @author David BRASSELY (david.brassely at graviteesource.com)
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
@JsonFilter("apiMembershipTypeFilter")
public class ApiEntity {
Expand All @@ -36,6 +38,7 @@ public class ApiEntity {
private String name;
private String version;
private String description;
private GroupEntity group;

@NotNull
@DeploymentRequired
Expand Down Expand Up @@ -253,6 +256,14 @@ public void setViews(Set<String> views) {
this.views = views;
}

public GroupEntity getGroup() {
return group;
}

public void setGroup(GroupEntity group) {
this.group = group;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down Expand Up @@ -283,6 +294,7 @@ public String toString() {
", permission=" + permission +
", tags=" + tags +
", view=" + views +
", group=" + group +
'}';
}
}
Expand Up @@ -21,14 +21,17 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* @author David BRASSELY (brasseld at gmail.com)
* @author David BRASSELY (david.brassely at graviteesource.com)
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public class ApplicationEntity {

private String id;
private String name;
private String description;
private String type;
private GroupEntity group;

@JsonProperty("created_at")
private Date createdAt;
Expand Down Expand Up @@ -127,7 +130,15 @@ public void setApisSize(int apisSize) {
this.apisSize = apisSize;
}

@Override
public GroupEntity getGroup() {
return group;
}

public void setGroup(GroupEntity group) {
this.group = group;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Expand Down
@@ -0,0 +1,102 @@
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.management.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.Objects;

/**
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public class GroupEntity {

private String id;
private GroupEntityType type;
private String name;

@JsonProperty("created_at")
private Date createdAt;

@JsonProperty("updated_at")
private Date updatedAt;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public GroupEntityType getType() {
return type;
}

public void setType(GroupEntityType type) {
this.type = type;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Date getCreatedAt() {
return createdAt;
}

public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

public Date getUpdatedAt() {
return updatedAt;
}

public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GroupEntity group = (GroupEntity) o;
return Objects.equals(id, group.id);
}

@Override
public int hashCode() {
return Objects.hash(id);
}

@Override
public String toString() {
return "GroupEntity{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", type='" + type + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
"}";
}
}
@@ -0,0 +1,24 @@
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.management.model;

/**
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public enum GroupEntityType {
APPLICATION, API
}
Expand Up @@ -19,7 +19,9 @@
import java.util.List;

/**
* @author David BRASSELY (brasseld at gmail.com)
* @author David BRASSELY (david.brassely at graviteesource.com)
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public class NewApiEntity {

Expand All @@ -38,6 +40,8 @@ public class NewApiEntity {
@NotNull
private String endpoint;

private String group;

private List<String> paths;

public String getName() {
Expand Down Expand Up @@ -88,6 +92,14 @@ public void setPaths(List<String> paths) {
this.paths = paths;
}

public String getGroup() {
return group;
}

public void setGroup(String group) {
this.group = group;
}

@Override
public String toString() {
return "NewApiEntity{" +
Expand All @@ -96,6 +108,7 @@ public String toString() {
", description='" + description + '\'' +
", contextPath='" + contextPath + '\'' +
", endpoint='" + endpoint + '\'' +
", group='" + group + '\'' +
'}';
}
}
Expand Up @@ -18,7 +18,9 @@
import javax.validation.constraints.NotNull;

/**
* @author David BRASSELY (brasseld at gmail.com)
* @author David BRASSELY (david.brassely at graviteesource.com)
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public class NewApplicationEntity {

Expand All @@ -30,6 +32,8 @@ public class NewApplicationEntity {

private String type;

private String group;

public String getDescription() {
return description;
}
Expand All @@ -54,12 +58,21 @@ public void setType(String type) {
this.type = type;
}

public String getGroup() {
return group;
}

public void setGroup(String group) {
this.group = group;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Application{");
sb.append("description='").append(description).append('\'');
sb.append(", name='").append(name).append('\'');
sb.append(", type='").append(type).append('\'');
sb.append(", group='").append(group).append('\'');
sb.append('}');
return sb.toString();
}
Expand Down
@@ -0,0 +1,54 @@
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.management.model;

import javax.validation.constraints.NotNull;

/**
* @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
* @author GraviteeSource Team
*/
public class NewGroupEntity {

@NotNull
private GroupEntityType type;
@NotNull
private String name;

public GroupEntityType getType() {
return type;
}

public void setType(GroupEntityType type) {
this.type = type;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

@Override
public String toString() {
return "NewGroupEntity{" +
", name='" + name + '\'' +
", type='" + type + '\'' +
"}";
}
}
Expand Up @@ -61,6 +61,8 @@ public class UpdateApiEntity {

private Set<String> views;

private String group;

public Visibility getVisibility() {
return visibility;
}
Expand Down Expand Up @@ -156,4 +158,12 @@ public Set<String> getViews() {
public void setViews(Set<String> views) {
this.views = views;
}

public String getGroup() {
return group;
}

public void setGroup(String group) {
this.group = group;
}
}

0 comments on commit 67b2ff3

Please sign in to comment.