index.js
function (roles, action) {
    var self = this;
    if (!action) {
      action = roles;
      roles = ['*'];
    }
    if (!Array.isArray(roles)) {
      roles = [roles];
    }
    roles.push('*');
    var matches = _.filter(roles, function (role) {
      var actions = self.permissions[role] || self.permissions['*'];
      return actions.indexOf(action) !== -1 || actions.indexOf('*') !== -1;
    });
    return matches.length > 0;
  }
function (roles, action) {
    var self = this;
    if (!action) {
      action = roles;
      roles = ['*'];
    }
    if (!Array.isArray(roles)) {
      roles = [roles];
    }
    roles.push('*');
    var matches = _.filter(roles, function (role) {
      var actions = self.permissions[role] || self.permissions['*'];
      return actions.indexOf(action) !== -1 || actions.indexOf('*') !== -1;
    });
    return matches.length > 0;
  }
Assert access to this acl's 'action' with role(s)

Can I write here with these roles?


@param  {String|Array} roles
@param  {String} action

@example

var ownerReading = acl.assert(['*','owner'], 'read')
var someoneWriting = acl.assert(['*']‚ 'write')

@return {Boolean}