Skip to content

Commit

Permalink
Added permission check for ProgramExport.groovy and EntitySQLProcesso…
Browse files Browse the repository at this point in the history
…r.groovy, If user does not have permission don't execute the groovy file (#821)
  • Loading branch information
dixitdeepak committed Jul 10, 2024
1 parent 6d9bd03 commit 31d8d7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import java.util.Iterator
import org.apache.ofbiz.entity.*
import org.apache.ofbiz.entity.model.ModelGroupReader

if (!security.hasPermission('ENTITY_MAINT', userLogin)) {
return
}
sqlCommand = context.request.getParameter("sqlCommand")

resultMessage = ""
Expand Down
3 changes: 3 additions & 0 deletions framework/webtools/groovyScripts/entity/ProgramExport.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.MultipleCompilationErrorsException
import org.codehaus.groovy.control.ErrorCollector

if (!security.hasPermission('ENTITY_MAINT', userLogin)) {
return
}
String groovyProgram = null
recordValues = []
errMsgList = []
Expand Down

0 comments on commit 31d8d7e

Please sign in to comment.