Skip to content

Commit 31d8d7e

Browse files
committed
Added permission check for ProgramExport.groovy and EntitySQLProcessor.groovy, If user does not have permission don't execute the groovy file (#821)
1 parent 6d9bd03 commit 31d8d7e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

framework/webtools/groovyScripts/entity/EntitySQLProcessor.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ import java.util.Iterator
2626
import org.apache.ofbiz.entity.*
2727
import org.apache.ofbiz.entity.model.ModelGroupReader
2828

29+
if (!security.hasPermission('ENTITY_MAINT', userLogin)) {
30+
return
31+
}
2932
sqlCommand = context.request.getParameter("sqlCommand")
3033

3134
resultMessage = ""

framework/webtools/groovyScripts/entity/ProgramExport.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ import org.codehaus.groovy.control.CompilerConfiguration
2929
import org.codehaus.groovy.control.MultipleCompilationErrorsException
3030
import org.codehaus.groovy.control.ErrorCollector
3131

32+
if (!security.hasPermission('ENTITY_MAINT', userLogin)) {
33+
return
34+
}
3235
String groovyProgram = null
3336
recordValues = []
3437
errMsgList = []

0 commit comments

Comments
 (0)