           }
           Relationship.count ownerSelector, createExistenceCallback callback
 
-  any:(client, group, permission, permissionSet, _, callback) ->
+
+  any: (client, group, permission, permissionSet, _, callback) ->
+
     { delegate } = client.connection
-    unless delegate
-      console.warn 'Delegate cannot be null for checking permissions, request is denied'
-      return callback null, no
+    return unless hasDelegate delegate, callback
+
     roleSelector = getRoleSelector delegate, group, permission, permissionSet
     return callback null, yes  if roleSelector is -1
     Relationship.count roleSelector, createExistenceCallback callback
-
-

    as        : { $in: roles }
  }

createExistenceCallback = (callback) -> (err, count) ->
  if err then callback err, no
  else if count > 0 then callback null, yes
  else callback null, no

module.exports =

  own:(client, group, permission, permissionSet, _, callback) ->
    { delegate } = client.connection

    return callback null, yes  if delegate.equals this

    roleSelector = getRoleSelector delegate, group, permission, permissionSet

          when permission in perm.permissions)
  roles.push 'admin' # admin can do anything!
  return roles


getRoleSelector = (delegate, group, permission, permissionSet) ->
  roles       = getRoles permission, permissionSet
