@@ -11,13 +11,15 @@ const DEFAULT_ACL_SUFFIX = '.acl'
1111class ACLChecker {
1212 constructor ( resource , options = { } ) {
1313 this . resource = resource
14+ this . host = options . host
15+ this . origin = options . origin
1416 this . debug = options . debug || console . log . bind ( console )
1517 this . fetch = options . fetch
1618 this . strictOrigin = options . strictOrigin
1719 this . suffix = options . suffix || DEFAULT_ACL_SUFFIX
1820 }
1921
20- can ( user , mode , options = { } ) {
22+ can ( user , mode ) {
2123 const debug = this . debug
2224 this . debug ( `Can ${ user || 'an agent' } ${ mode } ${ this . resource } ?` )
2325 // If this is an ACL, Control mode must be present for any operations
@@ -28,7 +30,7 @@ class ACLChecker {
2830 // Check the permissions within the nearest ACL
2931 return this . getNearestACL ( this . resource )
3032 . then ( nearestAcl => {
31- const acls = this . getPermissionSet ( nearestAcl , options )
33+ const acls = this . getPermissionSet ( nearestAcl )
3234 return this . checkAccess ( acls , user , mode , this . resource )
3335 } )
3436 . then ( ( ) => { debug ( 'ACL policy found' ) } )
@@ -111,7 +113,7 @@ class ACLChecker {
111113 }
112114
113115 // Gets the permission set for the given resource
114- getPermissionSet ( { acl, graph, isContainer } , options = { } ) {
116+ getPermissionSet ( { acl, graph, isContainer } ) {
115117 const debug = this . debug
116118 if ( ! graph || graph . length === 0 ) {
117119 debug ( 'ACL ' + acl + ' is empty' )
@@ -120,8 +122,8 @@ class ACLChecker {
120122 const aclOptions = {
121123 aclSuffix : this . suffix ,
122124 graph : graph ,
123- host : options . host ,
124- origin : options . origin ,
125+ host : this . host ,
126+ origin : this . origin ,
125127 rdf : rdf ,
126128 strictOrigin : this . strictOrigin ,
127129 isAcl : uri => this . isAcl ( uri ) ,
0 commit comments