def permitted?(model_name, requested_flags = 0)
      return false if self.kind != Kind::ROLE
      return true  if admin?

      p = self.model_permissions.find_by_model(model_name)
      if requested_flags == 0
        p
      else
        p && p.permitted?(requested_flags)
      end
    end
def permitted?(model_name, requested_flags = 0)
      return false if self.kind != Kind::ROLE
      return true  if admin?

      p = self.model_permissions.find_by_model(model_name)
      if requested_flags == 0
        p
      else
        p && p.permitted?(requested_flags)
      end
    end
return true if the role has enough permission on the controller.

 If user role is 'admin' then all operations are permitted.

 Always return false if the user-group is not ROLE.

 if requested_flags is omitted, just checks existence of
 model_permissions and doesn't check CRUD level.