@@ -105,7 +105,8 @@ ACL.prototype.can = function (user, mode, resource, callback, options) {
105105 } )
106106}
107107
108- ACL . prototype . findAgentClass = function ( graph , user , mode , resource , acl , callback ) {
108+ ACL . prototype . findAgentClass = function ( graph , user , mode , resource , acl ,
109+ callback ) {
109110 var self = this
110111
111112 // Agent class statement
@@ -131,7 +132,8 @@ ACL.prototype.findAgentClass = function (graph, user, mode, resource, acl, callb
131132 } , callback )
132133}
133134
134- ACL . prototype . findRule = function ( graph , user , mode , resource , accessType , acl , callback , options ) {
135+ ACL . prototype . findRule = function ( graph , user , mode , resource , accessType , acl ,
136+ callback , options ) {
135137 var self = this
136138
137139 // TODO check if this is necessary
@@ -155,7 +157,8 @@ ACL.prototype.findRule = function (graph, user, mode, resource, accessType, acl,
155157 var statementSubject = statement . subject . uri
156158
157159 // Check for origin
158- var matchOrigin = self . matchOrigin ( graph , statementSubject , options . origin , options . host )
160+ var matchOrigin = self . matchOrigin ( graph , statementSubject ,
161+ options . origin , options . host )
159162 if ( ! matchOrigin ) {
160163 debug ( 'The request does not match the origin' )
161164 return done ( false )
@@ -164,7 +167,8 @@ ACL.prototype.findRule = function (graph, user, mode, resource, accessType, acl,
164167 // Check for accessTo/defaultForNew
165168 if ( ! self . isAcl ( resource ) || accessType === 'defaultForNew' ) {
166169 debug ( 'Checking for accessType:' + accessType )
167- var accesses = self . matchAccessType ( graph , statementSubject , accessType , resource )
170+ var accesses = self . matchAccessType ( graph , statementSubject , accessType ,
171+ resource )
168172 if ( ! accesses ) {
169173 debug ( 'Cannot find accessType ' + accessType )
170174 return done ( false )
@@ -189,7 +193,8 @@ ACL.prototype.findRule = function (graph, user, mode, resource, accessType, acl,
189193
190194 debug ( 'Inspect agentClass' )
191195 // Check for AgentClass
192- return self . findAgentClass ( graph , user , mode , resource , statementSubject , done )
196+ return self . findAgentClass ( graph , user , mode , resource , statementSubject ,
197+ done )
193198 } ,
194199 function ( found ) {
195200 if ( ! found ) {
@@ -209,7 +214,8 @@ ACL.prototype.getMode = function getMode (graph, mode) {
209214 'http://www.w3.org/ns/auth/acl#' + mode )
210215}
211216
212- ACL . prototype . matchAccessType = function matchAccessType ( graph , rule , accessType , uri ) {
217+ ACL . prototype . matchAccessType = function matchAccessType ( graph , rule ,
218+ accessType , uri ) {
213219 var self = this
214220 var matches = self . match (
215221 graph ,
@@ -250,7 +256,8 @@ function possibleACLs (uri, suffix) {
250256 var first = S ( uri ) . endsWith ( suffix ) ? uri : uri + suffix
251257 var urls = [ first ]
252258 var parsedUri = url . parse ( uri )
253- var baseUrl = ( parsedUri . protocol ? parsedUri . protocol + '//' : '' ) + ( parsedUri . host || '' )
259+ var baseUrl = ( parsedUri . protocol ? parsedUri . protocol + '//' : '' ) +
260+ ( parsedUri . host || '' )
254261 if ( baseUrl + '/' === uri ) {
255262 return urls
256263 }
@@ -301,18 +308,19 @@ function getUserId (req, callback) {
301308 }
302309
303310 var delegator = rdfVocab . debrack ( onBehalfOf )
304- verifyDelegator ( req . hostname , delegator , req . session . userId , function ( err , res ) {
305- if ( err ) {
306- err . status = 500
307- return callback ( err )
308- }
311+ verifyDelegator ( req . hostname , delegator , req . session . userId ,
312+ function ( err , res ) {
313+ if ( err ) {
314+ err . status = 500
315+ return callback ( err )
316+ }
309317
310- if ( res ) {
311- debug ( 'Request User ID (delegation) :' + delegator )
312- return callback ( null , delegator )
313- }
314- return callback ( null , req . session . userId )
315- } )
318+ if ( res ) {
319+ debug ( 'Request User ID (delegation) :' + delegator )
320+ return callback ( null , delegator )
321+ }
322+ return callback ( null , req . session . userId )
323+ } )
316324}
317325
318326function verifyDelegator ( host , ldp , baseUri , delegator , delegatee , callback ) {
@@ -365,7 +373,9 @@ function allow (mode) {
365373 getUserId ( req , function ( err , userId ) {
366374 if ( err ) return next ( err )
367375
368- var reqPath = res && res . locals && res . locals . path ? res . locals . path : req . path
376+ var reqPath = res && res . locals && res . locals . path
377+ ? res . locals . path
378+ : req . path
369379 ldp . exists ( req . hostname , reqPath , function ( err , stat ) {
370380 if ( reqPath [ reqPath . length - 1 ] !== '/' &&
371381 ! err &&
0 commit comments