code: def secure(func_or_obj, check_permissions_for_obj=None):
      
      if _allowed_check_permissions_types(func_or_obj):
          return _secure_method(func_or_obj)
      else:
          if not _allowed_check_permissions_types(check_permissions_for_obj):
              msg = "When securing an object, secure() requires the " + \
                    "second argument to be method"
              raise TypeError(msg)
          return _SecuredAttribute(func_or_obj, check_permissions_for_obj)
docs: This method secures a method or class depending on invocation.
  
      To decorate a method use one argument:
          @secure(<check_permissions_method>)
  
      To secure a class, invoke with two arguments:
          secure(<obj instance>, <check_permissions_method>)