Search in sources :

Example 1 with UpdateListPermissionException

use of net.geoprism.registry.roles.UpdateListPermissionException in project geoprism-registry by terraframe.

the class ListType method enforceActorHasPermission.

public void enforceActorHasPermission(Operation op) {
    if (!doesActorHaveWritePermission()) {
        if (op.equals(Operation.CREATE)) {
            CreateListPermissionException ex = new CreateListPermissionException();
            ex.setOrganization(this.getOrganization().getDisplayLabel().getValue());
            throw ex;
        } else if (op.equals(Operation.WRITE)) {
            UpdateListPermissionException ex = new UpdateListPermissionException();
            ex.setOrganization(this.getOrganization().getDisplayLabel().getValue());
            throw ex;
        }
    }
}
Also used : UpdateListPermissionException(net.geoprism.registry.roles.UpdateListPermissionException) CreateListPermissionException(net.geoprism.registry.roles.CreateListPermissionException)

Example 2 with UpdateListPermissionException

use of net.geoprism.registry.roles.UpdateListPermissionException in project geoprism-registry by terraframe.

the class MasterList method enforceActorHasPermission.

public void enforceActorHasPermission(Operation op) {
    if (!doesActorHaveWritePermission()) {
        if (op.equals(Operation.CREATE)) {
            CreateListPermissionException ex = new CreateListPermissionException();
            ex.setOrganization(this.getOrganization().getDisplayLabel().getValue());
            throw ex;
        } else if (op.equals(Operation.WRITE)) {
            UpdateListPermissionException ex = new UpdateListPermissionException();
            ex.setOrganization(this.getOrganization().getDisplayLabel().getValue());
            throw ex;
        }
    }
}
Also used : UpdateListPermissionException(net.geoprism.registry.roles.UpdateListPermissionException) CreateListPermissionException(net.geoprism.registry.roles.CreateListPermissionException)

Aggregations

CreateListPermissionException (net.geoprism.registry.roles.CreateListPermissionException)2 UpdateListPermissionException (net.geoprism.registry.roles.UpdateListPermissionException)2