You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/10/26 12:54:12 UTC

[syncope] branch master updated (11a17dc -> 48f89ac)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git.


    from 11a17dc  Fixing some more CodeQL notes
     new a0360a4  Upgrading Elasticsearch
     new 48f89ac  [SYNCOPE-1596] Restoring read from underlying PlainSchemaTO to properly set read-only attributes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../client/console/wizards/any/PlainAttrs.java     |  6 ++-
 .../client/enduser/wizards/any/PlainAttrs.java     | 44 ++++++++++++----------
 pom.xml                                            |  2 +-
 3 files changed, 29 insertions(+), 23 deletions(-)


[syncope] 01/02: Upgrading Elasticsearch

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit a0360a4e0bfac81a123164675bd552ce2125f89a
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Oct 22 15:58:14 2020 +0200

    Upgrading Elasticsearch
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 3314a4a..b3db02f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -432,7 +432,7 @@ under the License.
 
     <slf4j.version>2.0.0-alpha1</slf4j.version>
 
-    <elasticsearch.version>7.9.2</elasticsearch.version>
+    <elasticsearch.version>7.9.3</elasticsearch.version>
 
     <apacheds.version>2.0.0.AM26</apacheds.version>
     <apachedirapi.version>2.0.0</apachedirapi.version>


[syncope] 02/02: [SYNCOPE-1596] Restoring read from underlying PlainSchemaTO to properly set read-only attributes

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 48f89ac65431634cb0176d432daa15fbda1f8997
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Mon Oct 26 13:45:28 2020 +0100

    [SYNCOPE-1596] Restoring read from underlying PlainSchemaTO to properly set read-only attributes
---
 .../client/console/wizards/any/PlainAttrs.java     |  6 ++-
 .../client/enduser/wizards/any/PlainAttrs.java     | 44 ++++++++++++----------
 2 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
index d331e7a..b9dcda3 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
@@ -202,7 +202,8 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
 
                 @Override
                 protected void populateItem(final ListItem<Attr> item) {
-                    setPanel(schemas, item, false);
+                    PlainSchemaTO schema = schemas.get(item.getModelObject().getSchema());
+                    setPanel(schemas, item, schema == null ? false : schema.isReadonly());
                 }
             });
         }
@@ -226,7 +227,8 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
 
                 @Override
                 protected void populateItem(final ListItem<Attr> item) {
-                    setPanel(schemas, item, false);
+                    PlainSchemaTO schema = schemas.get(item.getModelObject().getSchema());
+                    setPanel(schemas, item, schema == null ? false : schema.isReadonly());
                 }
             });
         }
diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/wizards/any/PlainAttrs.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/wizards/any/PlainAttrs.java
index 5a5eeb1..7e1e66f 100644
--- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/wizards/any/PlainAttrs.java
+++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/wizards/any/PlainAttrs.java
@@ -402,24 +402,26 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 @Override
                 @SuppressWarnings({ "unchecked", "rawtypes" })
                 protected void populateItem(final ListItem<Attr> item) {
-                    Attr attrTO = item.getModelObject();
+                    Attr attr = item.getModelObject();
+                    PlainSchemaTO schema = schemas.get(attr.getSchema());
 
                     // set default values, if any
-                    if (attrTO.getValues().stream().noneMatch(StringUtils::isNotBlank)) {
-                        attrTO.getValues().clear();
-                        attrTO.getValues().addAll(getDefaultValues(attrTO.getSchema(), groupName));
+                    if (attr.getValues().stream().noneMatch(StringUtils::isNotBlank)) {
+                        attr.getValues().clear();
+                        attr.getValues().addAll(getDefaultValues(attr.getSchema(), groupName));
                     }
 
-                    AbstractFieldPanel<?> panel = getFieldPanel(schemas.get(attrTO.getSchema()));
-                    if (schemas.get(attrTO.getSchema()).isMultivalue()) {
+                    AbstractFieldPanel<?> panel = getFieldPanel(schemas.get(attr.getSchema()));
+                    if (schemas.get(attr.getSchema()).isMultivalue()) {
                         panel = new MultiFieldPanel.Builder<>(
                                 new PropertyModel<>(
-                                        attributableTO.getObject().getPlainAttr(attrTO.getSchema()), "values"))
-                                .build("panel", attrTO.getSchema(), FieldPanel.class.cast(panel));
+                                        attributableTO.getObject().getPlainAttr(attr.getSchema()), "values"))
+                                .build("panel", attr.getSchema(), FieldPanel.class.cast(panel));
                         // SYNCOPE-1215 the entire multifield panel must be readonly, not only its field
-                        ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly());
+                        ((MultiFieldPanel) panel).setReadOnly(schema == null ? false : schema.isReadonly());
                     } else {
-                        FieldPanel.class.cast(panel).setNewModel(attrTO.getValues());
+                        FieldPanel.class.cast(panel).setNewModel(attr.getValues()).
+                                setReadOnly(schema == null ? false : schema.isReadonly());
                     }
 
                     item.add(panel);
@@ -446,25 +448,27 @@ public class PlainAttrs extends AbstractAttrs<PlainSchemaTO> {
                 @Override
                 @SuppressWarnings({ "unchecked", "rawtypes" })
                 protected void populateItem(final ListItem<Attr> item) {
-                    Attr attrTO = item.getModelObject();
+                    Attr attr = item.getModelObject();
+                    PlainSchemaTO schema = schemas.get(attr.getSchema());
 
                     // set default values, if any
-                    if (attrTO.getValues().stream().noneMatch(StringUtils::isNotBlank)) {
-                        attrTO.getValues().clear();
-                        attrTO.getValues().addAll(getDefaultValues(attrTO.getSchema()));
+                    if (attr.getValues().stream().noneMatch(StringUtils::isNotBlank)) {
+                        attr.getValues().clear();
+                        attr.getValues().addAll(getDefaultValues(attr.getSchema()));
                     }
 
-                    AbstractFieldPanel<?> panel = getFieldPanel(schemas.get(attrTO.getSchema()));
-                    if (schemas.get(attrTO.getSchema()).isMultivalue()) {
+                    AbstractFieldPanel<?> panel = getFieldPanel(schemas.get(attr.getSchema()));
+                    if (schemas.get(attr.getSchema()).isMultivalue()) {
                         panel = new MultiFieldPanel.Builder<>(
-                                new PropertyModel<>(attrTO, "values")).build(
+                                new PropertyModel<>(attr, "values")).build(
                                 "panel",
-                                attrTO.getSchema(),
+                                attr.getSchema(),
                                 FieldPanel.class.cast(panel));
                         // SYNCOPE-1215 the entire multifield panel must be readonly, not only its field
-                        ((MultiFieldPanel) panel).setReadOnly(schemas.get(attrTO.getSchema()).isReadonly());
+                        ((MultiFieldPanel) panel).setReadOnly(schema == null ? false : schema.isReadonly());
                     } else {
-                        FieldPanel.class.cast(panel).setNewModel(attrTO.getValues());
+                        FieldPanel.class.cast(panel).setNewModel(attr.getValues()).
+                                setReadOnly(schema == null ? false : schema.isReadonly());
                     }
                     item.add(panel);
                 }