Fixed authorship check
This commit is contained in:
parent
9314e67830
commit
25bce13814
|
@ -279,11 +279,11 @@ public class CKANPackage extends CKAN implements Moderated {
|
||||||
}else { // this prevent to change the original author in case of update
|
}else { // this prevent to change the original author in case of update
|
||||||
Role role = ckanUser.getRole();
|
Role role = ckanUser.getRole();
|
||||||
if(role.ordinal() < Role.ADMIN.ordinal()) {
|
if(role.ordinal() < Role.ADMIN.ordinal()) {
|
||||||
if(result.get(AUTHOR_KEY).asText().compareTo(authorName)!=0) {
|
if(objectNode.get(AUTHOR_KEY).asText().compareTo(authorName)!=0) {
|
||||||
throw new BadRequestException("Only Catalogue-Admins or above can change the authorship (i.e. " + AUTHOR_KEY + " field) of an item.");
|
throw new BadRequestException("Only Catalogue-Admins or above can change the authorship (i.e. " + AUTHOR_KEY + " field) of an item.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result.get(AUTHOR_EMAIL_KEY).asText().compareTo(authorEmail)!=0) {
|
if(objectNode.get(AUTHOR_EMAIL_KEY).asText().compareTo(authorEmail)!=0) {
|
||||||
throw new BadRequestException("Only Catalogue-Admins or above can change the authorship (i.e. " + AUTHOR_EMAIL_KEY + " field) of an item.");
|
throw new BadRequestException("Only Catalogue-Admins or above can change the authorship (i.e. " + AUTHOR_EMAIL_KEY + " field) of an item.");
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
|
|
Loading…
Reference in New Issue