Grant/revoke a union of catalog data source summary and details access permissions when either is changed.
@@ -133,15 +133,23 @@ public class JcrDataSourceAllowedActions extends JcrAllowedActions {
if (action.implies(DatasourceAccessControl.CHANGE_PERMS)) {
Collections.addAll(detailPrivs, Privilege.JCR_READ_ACCESS_CONTROL, Privilege.JCR_MODIFY_ACCESS_CONTROL);
Collections.addAll(summaryPrivs, Privilege.JCR_READ_ACCESS_CONTROL, Privilege.JCR_MODIFY_ACCESS_CONTROL);
- } else if (action.implies(DatasourceAccessControl.EDIT_DETAILS)) {
+ } else if (action.implies(DatasourceAccessControl.EDIT_DETAILS) || action.implies(DatasourceAccessControl.EDIT_SUMMARY)) {
detailPrivs.add(Privilege.JCR_ALL);
- } else if (action.implies(DatasourceAccessControl.EDIT_SUMMARY)) {
summaryPrivs.add(Privilege.JCR_ALL);
- } else if (action.implies(DatasourceAccessControl.ACCESS_DETAILS)) {
+ } else if (action.implies(DatasourceAccessControl.ACCESS_DETAILS) || action.implies(DatasourceAccessControl.ACCESS_DATASOURCE)) {
detailPrivs.add(Privilege.JCR_READ);
- } else if (action.implies(DatasourceAccessControl.ACCESS_DATASOURCE)) {
summaryPrivs.add(Privilege.JCR_READ);
}
+// TODO: Re-enable equivalent below after proper, catalog data source-specific roles and permissions are created.
+// } else if (action.implies(DatasourceAccessControl.EDIT_DETAILS)) {
+// detailPrivs.add(Privilege.JCR_ALL);
+// } else if (action.implies(DatasourceAccessControl.EDIT_SUMMARY)) {
+// summaryPrivs.add(Privilege.JCR_ALL);
+// } else if (action.implies(DatasourceAccessControl.ACCESS_DETAILS)) {
+// detailPrivs.add(Privilege.JCR_READ);
+// } else if (action.implies(DatasourceAccessControl.ACCESS_DATASOURCE)) {
+// summaryPrivs.add(Privilege.JCR_READ);
+// }
});
JcrAccessControlUtil.setPermissions(this.dataSource.getNode(), principal, summaryPrivs);
