Fix vaious issues with organizations
This commit is contained in:
parent
a8f75aafb9
commit
fe8a0ff109
|
@ -64,7 +64,7 @@ public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryableList<Organisation> getAuthenticated(QueryableList<Organisation> query, UserInfo principal) {
|
public QueryableList<Organisation> getAuthenticated(QueryableList<Organisation> query, UserInfo principal) {
|
||||||
query.where((builder, root) -> builder.equal(root.join("dmps").get("creator"), principal));
|
query.where((builder, root) -> builder.equal(root.join("dmps").join("users").get("user"), principal));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class Organisation implements DataModel<eu.eudat.data.entities.Organisati
|
||||||
public eu.eudat.data.entities.Organisation toDataModel() {
|
public eu.eudat.data.entities.Organisation toDataModel() {
|
||||||
eu.eudat.data.entities.Organisation organisationEntity = new eu.eudat.data.entities.Organisation();
|
eu.eudat.data.entities.Organisation organisationEntity = new eu.eudat.data.entities.Organisation();
|
||||||
if (this.key != null && this.reference != null) {
|
if (this.key != null && this.reference != null) {
|
||||||
if ((this.key + ":").equals(this.reference.substring(0, this.key.length() + 1))) {
|
if (this.reference.startsWith(this.key + ":")) {
|
||||||
organisationEntity.setReference(this.reference);
|
organisationEntity.setReference(this.reference);
|
||||||
} else {
|
} else {
|
||||||
organisationEntity.setReference(this.key + ":" + this.reference);
|
organisationEntity.setReference(this.key + ":" + this.reference);
|
||||||
|
|
Loading…
Reference in New Issue