Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jun 1, 2023
2 parents d79fa5d + b1b58d4 commit 6a58320
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14439,6 +14439,27 @@
</xsd:documentation>
<xsd:appinfo>
<a:container>true</a:container>
<a:schemaMigration>
<a:element>tns:roleCatalogRef</a:element>
<a:version>4.8</a:version>
<a:operation>moved</a:operation>
<a:comment>Moved to adminGuiConfiguration/accessRequest/roleCatalog/roleCatalogRef</a:comment>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:roleCatalogCollections</a:element>
<a:version>4.8</a:version>
<a:operation>moved</a:operation>
<a:comment>Moved to adminGuiConfiguration/accessRequest/roleCatalog/collection. Requires value converting
(roleCatalogCollections.collection.collectionUri -> collection.identifier)</a:comment>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:defaultCollection</a:element>
<a:version>4.8</a:version>
<a:operation>moved</a:operation>
<a:comment>Moved to adminGuiConfiguration/accessRequest/roleCatalog/collection. Requires value converting
(roleCatalogCollections.collection.collectionUri -> collection.identifier;
collection.default should be set to true)</a:comment>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Expand All @@ -14450,58 +14471,6 @@
</xsd:annotation>
</xsd:element>
<xsd:element ref="tns:documentation" minOccurs="0"/>
<xsd:element name="roleCatalogRef" type="c:ObjectReferenceType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Reference to the root object of the role catalog.

DEPRECATED: Configuration was moved to adminGuiConfiguration/accessRequest/roleCatalog
</xsd:documentation>
<xsd:appinfo>
<a:objectReferenceTargetType>tns:OrgType</a:objectReferenceTargetType>
<a:displayName>RoleManagementConfigurationType.roleCatalogRef</a:displayName>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>4.6</a:deprecatedSince>
<a:plannedRemoval>4.8</a:plannedRemoval>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="roleCatalogCollections" type="tns:ObjectCollectionsUseType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Specifies the set of object collections ("role catalog views") to display in role
catalog. If this element is not specified then the default (hardcoded) collections
will be displayed. If this element is specified then only those collections specified
in this element are displayed.

DEPRECATED: Configuration was moved to adminGuiConfiguration/accessRequest/roleCatalog
</xsd:documentation>
<xsd:appinfo>
<a:since>3.6</a:since>
<a:displayName>RoleManagementConfigurationType.roleCatalogCollections</a:displayName>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>4.6</a:deprecatedSince>
<a:plannedRemoval>4.8</a:plannedRemoval>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="defaultCollection" type="tns:ObjectCollectionUseType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Specifies the default object collections ("role catalog view") to display in role
catalog.

DEPRECATED: Configuration was moved to adminGuiConfiguration/accessRequest/roleCatalog
</xsd:documentation>
<xsd:appinfo>
<a:since>3.6</a:since>
<a:displayName>RoleManagementConfigurationType.defaultCollection</a:displayName>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>4.6</a:deprecatedSince>
<a:plannedRemoval>4.8</a:plannedRemoval>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="defaultAssignmentConstraints" type="tns:AssignmentConstraintsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,53 +421,11 @@ private void mergeDeprecatedRoleManagement(CompiledGuiProfile composite, RoleMan
ar.setDocumentation(roleManagement.getDocumentation());
}

mergeRoleManagementRoleCatalog(ar, roleManagement);
}

private void mergeRoleManagementRoleCatalog(AccessRequestType result, RoleManagementConfigurationType deprecated) {
RoleCatalogType rc = result.getRoleCatalog();
if (rc == null) {
rc = new RoleCatalogType();
result.setRoleCatalog(rc);
}

if (rc.getRoleCatalogRef() == null && deprecated.getRoleCatalogRef() != null) {
rc.setRoleCatalogRef(deprecated.getRoleCatalogRef());
}

List<RoleCollectionViewType> collection = rc.getCollection();
if (collection.isEmpty() && deprecated.getRoleCatalogCollections() != null) {
ObjectCollectionsUseType ocus = deprecated.getRoleCatalogCollections();
ocus.getCollection().forEach(ocu -> {
RoleCollectionViewType rcv = mapObjectCollectionUse(ocu, false);
if (rcv != null) {
collection.add(rcv);
}
});
}

RoleCollectionViewType defaultCollection = mapObjectCollectionUse(deprecated.getDefaultCollection(), true);
if (defaultCollection != null) {
collection.add(defaultCollection);
if (ar.getRoleCatalog() == null) {
ar.setRoleCatalog(new RoleCatalogType());
}
}

private RoleCollectionViewType mapObjectCollectionUse(ObjectCollectionUseType ocu, boolean isDefault) {
if (ocu == null) {
return null;
}
String uri = ocu.getCollectionUri();
if (StringUtils.isEmpty(uri)) {
return null;
}

RoleCollectionViewType result = new RoleCollectionViewType();
result.setDefault(isDefault);
result.setCollectionIdentifier(uri);

return result;
}

private void mergeAccessRequestConfiguration(CompiledGuiProfile composite, AccessRequestType accessRequest) {
if (composite.getAccessRequest() == null) {
composite.setAccessRequest(accessRequest.clone());
Expand Down

0 comments on commit 6a58320

Please sign in to comment.