-
Notifications
You must be signed in to change notification settings - Fork 66
Running REST extensions with least privs when using modules from src #300
Comments
Temporary workaround, add this to deploy/app_specific.rb: # fix a deployment issue with modules not getting correct permissions
alias_method :original_deploy_modules, :deploy_modules
def deploy_modules()
original_deploy_modules
r = execute_query %Q{
xquery version "1.0-ml";
for $uri in cts:uris()
where ends-with($uri, ".xqy")
return (
$uri,
xdmp:document-add-permissions($uri, (
xdmp:permission("rest-extension-user", "execute"),
xdmp:permission("rest-admin", "update"),
xdmp:permission("rest-admin", "read")
))
)
},
{ :db_name => @properties["ml.modules-db"] }
end |
Roxy gives permissions to the app-role in deploy_src() (server_config.rb). On Thu, Nov 6, 2014 at 5:47 AM, Geert notifications@github.com wrote:
http://blog.davidcassel.net |
#300 adding REST-role permissions to normal code
fixed in dev. thanks! |
I had deployed a REST extension using admin, which was relying on a modules loaded from src/. I then tried accessing that REST extension using a least-privs user. That resulted in this misleading message:
I was able to get round this by running the following against the modules database:
Apparently we need to apply more permissions to modules by default in REST and Hybrid type applications..
Next to this, a 'permissions' properties, that lets you specify extra permissions for content and/or modules would be great..
The text was updated successfully, but these errors were encountered: