Skip to content

Commit

Permalink
add permission exception if property creation doesnt have associated …
Browse files Browse the repository at this point in the history
…domain
  • Loading branch information
geektortoise committed May 31, 2021
1 parent 7af72e6 commit 8cb53d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions grails-app/services/be/cytomine/meta/PropertyService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package be.cytomine.meta

import be.cytomine.AnnotationDomain
import be.cytomine.CytomineDomain
import be.cytomine.Exception.InvalidRequestException
import be.cytomine.command.*
import be.cytomine.meta.Property
import be.cytomine.image.ImageInstance
Expand Down Expand Up @@ -139,6 +140,10 @@ class PropertyService extends ModelService {
def domainClass = json.domainClassName
CytomineDomain domain

if(!domainClass || !json.domainIdent){
throw new InvalidRequestException("Property has no associated domain")
}

if(domainClass.contains("AnnotationDomain")) {
domain = AnnotationDomain.getAnnotationDomain(json.domainIdent)
} else {
Expand Down

0 comments on commit 8cb53d2

Please sign in to comment.