diff --git a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java index 6a171b953e2a..6e2e0490bd50 100644 --- a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java +++ b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java @@ -80,6 +80,9 @@ private RoleConstants() { public static final String NEW_ROLE_NAME = "newRoleName"; public static final String FAILURE_REASON = "failureReason"; + // Role properties + public static final String IS_SHARED_ROLE_PROP_NAME = "isSharedRole"; + /** * Grouping of constants related to database table names. */ diff --git a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java index c5b708e5e997..afda51b8a265 100644 --- a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java +++ b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java @@ -54,6 +54,7 @@ import org.wso2.carbon.identity.role.v2.mgt.core.model.RoleAudience; import org.wso2.carbon.identity.role.v2.mgt.core.model.RoleBasicInfo; import org.wso2.carbon.identity.role.v2.mgt.core.model.RoleDTO; +import org.wso2.carbon.identity.role.v2.mgt.core.model.RoleProperty; import org.wso2.carbon.identity.role.v2.mgt.core.model.UserBasicInfo; import org.wso2.carbon.identity.role.v2.mgt.core.util.GroupIDResolver; import org.wso2.carbon.identity.role.v2.mgt.core.util.UserIDResolver; @@ -400,6 +401,12 @@ private List getRolesRequestedAttributes(List roles, List associatedApplications; + private List roleProperties = new ArrayList<>(); public Role() { @@ -281,4 +283,34 @@ public void setAssociatedApplications(List associatedAppl this.associatedApplications = associatedApplications; } + + /** + * Get the role properties. + * + * @return properties list of a role. + */ + public List getRoleProperties() { + + return roleProperties; + } + + /** + * Set the role properties. + * + * @param roleProperties properties list of a role. + */ + public void setRoleProperties(List roleProperties) { + + this.roleProperties = roleProperties; + } + + /** + * Set a role property to the role properties list. + * + * @param roleProperty a property of a role. + */ + public void setRoleProperty(RoleProperty roleProperty) { + + this.roleProperties.add(roleProperty); + } } diff --git a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/model/RoleProperty.java b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/model/RoleProperty.java new file mode 100644 index 000000000000..73f943a3b457 --- /dev/null +++ b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/model/RoleProperty.java @@ -0,0 +1,73 @@ +package org.wso2.carbon.identity.role.v2.mgt.core.model; + +import java.io.Serializable; + +/** + * Role property object to store the role specific property details. + */ +public class RoleProperty implements Serializable { + + private String name; + private String value; + private String displayName; + + /** + * Get the value of the property. + * + * @return value. + */ + public String getValue() { + + return value; + } + + /** + * Set the value of the property. + * + * @param value Value of the property. + */ + public void setValue(String value) { + + this.value = value; + } + + /** + * Get the display name of the property. + * + * @return Display name. + */ + public String getDisplayName() { + + return displayName; + } + + /** + * Set display name of the property. + * + * @param displayName Display name. + */ + public void setDisplayName(String displayName) { + + this.displayName = displayName; + } + + /** + * Get the name of the property. + * + * @return Name (This is the key). + */ + public String getName() { + + return name; + } + + /** + * Set the name of the property. + * + * @param name (This is the key). + */ + public void setName(String name) { + + this.name = name; + } +}