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

Commit

Permalink
feat: Invite a user in a group
Browse files Browse the repository at this point in the history
  • Loading branch information
aelamrani committed Feb 18, 2019
1 parent 727e5e8 commit 1e5f2cc
Show file tree
Hide file tree
Showing 40 changed files with 1,565 additions and 179 deletions.
Expand Up @@ -33,19 +33,22 @@ public class GroupEntity {
private String name;
@JsonProperty("event_rules")
private List<GroupEventRuleEntity> eventRules;

boolean manageable;

/**
* Roles
*/
private Map<RoleScope, String> roles;

@JsonProperty("created_at")
private Date createdAt;

@JsonProperty("updated_at")
private Date updatedAt;
@JsonProperty("max_invitation")
private Integer maxInvitation;
@JsonProperty("lock_api_role")
private boolean lockApiRole;
@JsonProperty("lock_application_role")
private boolean lockApplicationRole;
@JsonProperty("system_invitation")
private boolean systemInvitation;
@JsonProperty("email_invitation")
private boolean emailInvitation;

public String getId() {
return id;
Expand Down Expand Up @@ -103,6 +106,46 @@ public void setRoles(Map<RoleScope, String> roles) {
this.roles = roles;
}

public Integer getMaxInvitation() {
return maxInvitation;
}

public void setMaxInvitation(Integer maxInvitation) {
this.maxInvitation = maxInvitation;
}

public boolean isLockApiRole() {
return lockApiRole;
}

public void setLockApiRole(boolean lockApiRole) {
this.lockApiRole = lockApiRole;
}

public boolean isLockApplicationRole() {
return lockApplicationRole;
}

public void setLockApplicationRole(boolean lockApplicationRole) {
this.lockApplicationRole = lockApplicationRole;
}

public boolean isSystemInvitation() {
return systemInvitation;
}

public void setSystemInvitation(boolean systemInvitation) {
this.systemInvitation = systemInvitation;
}

public boolean isEmailInvitation() {
return emailInvitation;
}

public void setEmailInvitation(boolean emailInvitation) {
this.emailInvitation = emailInvitation;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -121,9 +164,16 @@ public String toString() {
return "GroupEntity{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", eventRules='" + eventRules + '\'' +
", eventRules=" + eventRules +
", manageable=" + manageable +
", roles=" + roles +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
"}";
", maxInvitation=" + maxInvitation +
", lockApiRole=" + lockApiRole +
", lockApplicationRole=" + lockApplicationRole +
", systemInvitation=" + systemInvitation +
", emailInvitation=" + emailInvitation +
'}';
}
}
Expand Up @@ -36,14 +36,10 @@ public GroupMemberEntity(MemberEntity memberEntity) {
}

private String id;

private String displayName;

private Map<String, String> roles;

@JsonProperty("created_at")
private Date createdAt;

@JsonProperty("updated_at")
private Date updatedAt;

Expand Down
@@ -0,0 +1,133 @@
/**
* 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 Azize ELAMRANI (azize.elamrani at graviteesource.com)
* @author GraviteeSource Team
*/
public class InvitationEntity {
private String id;
@JsonProperty("reference_type")
private InvitationReferenceType referenceType;
@JsonProperty("reference_id")
private String referenceId;
private String email;
@JsonProperty("api_role")
private String apiRole;
@JsonProperty("application_role")
private String applicationRole;
@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 InvitationReferenceType getReferenceType() {
return referenceType;
}

public void setReferenceType(InvitationReferenceType referenceType) {
this.referenceType = referenceType;
}

public String getReferenceId() {
return referenceId;
}

public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getApiRole() {
return apiRole;
}

public void setApiRole(String apiRole) {
this.apiRole = apiRole;
}

public String getApplicationRole() {
return applicationRole;
}

public void setApplicationRole(String applicationRole) {
this.applicationRole = applicationRole;
}

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 instanceof InvitationEntity)) return false;
InvitationEntity that = (InvitationEntity) o;
return Objects.equals(id, that.id);
}

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

@Override
public String toString() {
return "InvitationEntity{" +
"id='" + id + '\'' +
", referenceType=" + referenceType +
", referenceId='" + referenceId + '\'' +
", email='" + email + '\'' +
", apiRole='" + apiRole + '\'' +
", applicationRole='" + applicationRole + '\'' +
", 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 Azize ELAMRANI (azize.elamrani at graviteesource.com)
* @author GraviteeSource Team
*/
public enum InvitationReferenceType {
API, APPLICATION, GROUP
}
Expand Up @@ -28,9 +28,16 @@ public class NewGroupEntity {

@NotNull
private String name;

@JsonProperty("event_rules")
private List<GroupEventRuleEntity> eventRules;
private Integer maxInvitation;
@JsonProperty("lock_api_role")
private boolean lockApiRole;
@JsonProperty("lock_application_role")
private boolean lockApplicationRole;
private boolean systemInvitation;
@JsonProperty("email_invitation")
private boolean emailInvitation;

public String getName() {
return name;
Expand All @@ -48,11 +55,56 @@ public void setEventRules(List<GroupEventRuleEntity> eventRules) {
this.eventRules = eventRules;
}

public Integer getMaxInvitation() {
return maxInvitation;
}

public void setMaxInvitation(Integer maxInvitation) {
this.maxInvitation = maxInvitation;
}

public boolean isLockApiRole() {
return lockApiRole;
}

public void setLockApiRole(boolean lockApiRole) {
this.lockApiRole = lockApiRole;
}

public boolean isLockApplicationRole() {
return lockApplicationRole;
}

public void setLockApplicationRole(boolean lockApplicationRole) {
this.lockApplicationRole = lockApplicationRole;
}

public boolean isSystemInvitation() {
return systemInvitation;
}

public void setSystemInvitation(boolean systemInvitation) {
this.systemInvitation = systemInvitation;
}

public boolean isEmailInvitation() {
return emailInvitation;
}

public void setEmailInvitation(boolean emailInvitation) {
this.emailInvitation = emailInvitation;
}

@Override
public String toString() {
return "NewGroupEntity{" +
", name='" + name + '\'' +
", eventRules='" + eventRules + '\'' +
"}";
"name='" + name + '\'' +
", eventRules=" + eventRules +
", maxInvitation=" + maxInvitation +
", lockApiRole=" + lockApiRole +
", lockApplicationRole=" + lockApplicationRole +
", systemInvitation=" + systemInvitation +
", emailInvitation=" + emailInvitation +
'}';
}
}

0 comments on commit 1e5f2cc

Please sign in to comment.