diff --git a/types/acl/index.d.ts b/types/acl/index.d.ts index 3aa81de8e3..43de3f5369 100644 --- a/types/acl/index.d.ts +++ b/types/acl/index.d.ts @@ -50,7 +50,10 @@ interface Acl { allowedPermissions: (userId: Value, resources: strings, cb?: AnyCallback) => Promise; isAllowed: (userId: Value, resources: strings, permissions: strings, cb?: AllowedCallback) => Promise; areAnyRolesAllowed: (roles: strings, resource: strings, permissions: strings, cb?: AllowedCallback) => Promise; - whatResources: (roles: strings, permissions: strings, cb?: AnyCallback) => Promise; + whatResources: { + (roles: strings, cb?: AnyCallback): Promise; + (roles: strings, permissions: strings, cb?: AnyCallback): Promise; + } permittedResources: (roles: strings, permissions: strings, cb?: Function) => Promise; middleware: (numPathComponents?: number, userId?: Value | GetUserId, actions?: strings) => express.RequestHandler; } diff --git a/types/acl/test/index.ts b/types/acl/test/index.ts index c29574326d..bb3e6fa54e 100644 --- a/types/acl/test/index.ts +++ b/types/acl/test/index.ts @@ -66,6 +66,18 @@ acl.isAllowed('joed', 'blogs', 'view', (err, res) => { } }); +acl.whatResources('foo', (err, res) => { + if (res) { + console.log(res); + } +}); + +acl.whatResources('foo', 'view', (err, res) => { + if (res) { + console.log(res); + } +}); + acl.isAllowed('jsmith', 'blogs', ['edit','view','delete']) .then((result) => { console.dir('jsmith is allowed blogs ' + result);