Skip to content

Commit

Permalink
Following #2753: small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ebruchez committed Nov 11, 2022
1 parent a34ef0a commit 4104f40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<xf:model
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:saxon="http://saxon.sf.net/"
xmlns:frf="java:org.orbeon.oxf.fr.FormRunner"

id="fb-permissions-model">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ import org.orbeon.scaxon.SimplePath._

trait FormBuilderPermissionsOps {

private val SupportedFormBuilderPermissionsPaths = List(
"/config/form-builder-permissions.xml",
"/config/form-runner-roles.xml"
)

// Load form-builder-permissions.xml. For code called from XForms, that instance is loaded in permissions-model.xml.
//@XPathFunction
def formBuilderPermissionsConfiguration: Option[DocumentInfo] = {

val supportedPaths = List(
"/config/form-builder-permissions.xml",
"/config/form-runner-roles.xml"
)

val resourceManager = ResourceManagerWrapper.instance

supportedPaths collectFirst
{case key if resourceManager.exists(key) => resourceManager.getContentAsOrbeonDom(key)} map
(new DocumentWrapper(_, null, XPath.GlobalConfiguration))
SupportedFormBuilderPermissionsPaths collectFirst { case key if resourceManager.exists(key) =>
new DocumentWrapper(resourceManager.getContentAsOrbeonDom(key), null, XPath.GlobalConfiguration)
}
}

//@XPathFunction
Expand Down

0 comments on commit 4104f40

Please sign in to comment.