Skip to content

Commit 38c8e7f

Browse files
committed
[KNOWAGE-9621] prevent users from executing documents with an expired license
1 parent 2799415 commit 38c8e7f

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

knowage-core/src/main/java/it/eng/spagobi/api/v3/DocumentExecutionResource.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ public JSONObject getDocumentTemplates(@PathParam("id") Integer id) throws JSONE
9898
IBIObjectDAO documentDao = DAOFactory.getBIObjectDAO();
9999
BIObject document = documentDao.loadBIObjectById(id);
100100

101-
if (!ProductProfiler.canExecuteDocumentByLicenseExpiredOrAbsent(document)) {
102-
String message = "This document cannot be executed within the current product";
103-
LOGGER.error(message);
104-
throw new SpagoBIRuntimeException(message);
105-
}
106-
107101
if (!ObjectsAccessVerifier.canExec(document, userProfile)) {
108102
String message = "User cannot exec the document";
109103
LOGGER.error(message);
@@ -269,7 +263,7 @@ private List<String> getModelRoles(UserProfile userProfile, MetaModel model) thr
269263

270264
private void checkExecRightsByProducts(BIObject biobj) throws EMFUserError {
271265

272-
if (!ProductProfiler.canExecuteDocument(biobj)) {
266+
if (!ProductProfiler.canExecuteDocumentByLicenseExpiredOrAbsent(biobj)) {
273267
throw new SpagoBIRuntimeException("This document cannot be executed within the current product");
274268
}
275269
}

0 commit comments

Comments
 (0)