Skip to content

Commit

Permalink
feat(groups): restrict pages and documentation to a set of groups
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGeraud authored and brasseld committed Oct 10, 2017
1 parent f3e60c3 commit d772ae0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -32,8 +32,8 @@
<name>Gravitee.io APIM - Repository - AWS DynamoDB</name>

<properties>
<gravitee-repository.version>1.9.0</gravitee-repository.version>
<gravitee-repository-test.version>1.9.0</gravitee-repository-test.version>
<gravitee-repository.version>1.10.0-SNAPSHOT</gravitee-repository.version>
<gravitee-repository-test.version>1.10.0-SNAPSHOT</gravitee-repository-test.version>
<maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
<aws-java-sdk-bom.version>1.11.123</aws-java-sdk-bom.version>
</properties>
Expand Down
Expand Up @@ -182,6 +182,7 @@ private Page convert(DynamoDBPage dynamoDBPage) {
page.setPublished(dynamoDBPage.isPublished());
page.setType(PageType.valueOf(dynamoDBPage.getType()));
page.setHomepage(dynamoDBPage.isHomepage());
page.setExcludedGroups(dynamoDBPage.getExcludedGroups());

if (dynamoDBPage.getSourceType() != null) {
PageSource pageSource = new PageSource();
Expand Down Expand Up @@ -211,6 +212,7 @@ private DynamoDBPage convert(Page page) {
dynamoDBPage.setPublished(page.isPublished());
dynamoDBPage.setType(page.getType().name());
dynamoDBPage.setHomepage(page.isHomepage());
dynamoDBPage.setExcludedGroups(page.getExcludedGroups());

if (page.getSource() != null) {
dynamoDBPage.setSourceType(page.getSource().getType());
Expand Down
Expand Up @@ -134,6 +134,7 @@ private Plan convert(DynamoDBPlan dynamoDBPlan) {
plan.setApis(dynamoDBPlan.getApis());
plan.setDescription(dynamoDBPlan.getDescription());
plan.setDefinition(dynamoDBPlan.getDefinition());
plan.setExcludedGroups(dynamoDBPlan.getExcludedGroups());

if (dynamoDBPlan.getValidation() != null) {
plan.setValidation(Plan.PlanValidationType.valueOf(dynamoDBPlan.getValidation()));
Expand Down Expand Up @@ -169,7 +170,7 @@ private DynamoDBPlan convert(Plan plan) {
DynamoDBPlan dynamoDBPlan = new DynamoDBPlan();
dynamoDBPlan.setId(plan.getId());
dynamoDBPlan.setName(plan.getName());
dynamoDBPlan.setOrder(dynamoDBPlan.getOrder());
dynamoDBPlan.setOrder(plan.getOrder());

if (plan.getType() != null) {
dynamoDBPlan.setType(plan.getType().name());
Expand All @@ -184,6 +185,7 @@ private DynamoDBPlan convert(Plan plan) {
}
dynamoDBPlan.setDescription(plan.getDescription());
dynamoDBPlan.setDefinition(plan.getDefinition());
dynamoDBPlan.setExcludedGroups(plan.getExcludedGroups());

if (plan.getValidation() != null) {
dynamoDBPlan.setValidation(plan.getValidation().name());
Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTyped;

import java.util.List;
import java.util.Objects;

import static com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperFieldModel.DynamoDBAttributeType.BOOL;
Expand Down Expand Up @@ -66,6 +67,9 @@ public class DynamoDBPage {
@DynamoDBTyped(BOOL)
private boolean homepage;

@DynamoDBAttribute
private List<String> excludedGroups;

public String getId() {
return id;
}
Expand Down Expand Up @@ -171,6 +175,14 @@ public void setHomepage(boolean homepage) {
this.homepage = homepage;
}

public List<String> getExcludedGroups() {
return excludedGroups;
}

public void setExcludedGroups(List<String> excludedGroups) {
this.excludedGroups = excludedGroups;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
Expand Up @@ -55,6 +55,8 @@ public class DynamoDBPlan {
@DynamoDBAttribute
private String security;
@DynamoDBAttribute
private List<String> excludedGroups;
@DynamoDBAttribute
private long createdAt;
@DynamoDBAttribute
private long updatedAt;
Expand Down Expand Up @@ -150,6 +152,13 @@ public void setSecurity(String security) {
this.security = security;
}

public List<String> getExcludedGroups() {
return excludedGroups;
}
public void setExcludedGroups(List<String> excludedGroups) {
this.excludedGroups = excludedGroups;
}

public long getCreatedAt() {
return createdAt;
}
Expand Down

0 comments on commit d772ae0

Please sign in to comment.