Remove unused AppServer functions
@@ -282,62 +282,3 @@ def is_current_user_admin():
return (os.environ.get('USER_IS_ADMIN', '0')) == '1'
IsCurrentUserAdmin = is_current_user_admin
-
-def is_current_user_capable(api_name):
- """ Checks to see if the current user is capable to run a certain API
-
- Args:
- api_name: A string of the API to check for
- Returns:
- True if capable, False if not
- """
- user = get_current_user()
- if not user:
- sys.stderr.write("user is not logged in - cannot use api " + \
- api_name + "\n")
- return False
-
- email = user.email()
- return is_user_capable(email, api_name)
-
-def is_user_capable(user, api_name):
- """ Checks to see if the given user has access to user a particular API.
-
- Args:
- user: The current user email
- api_name: The API we're checking to see if the user has permission
- Returns:
- True is capable, False otherwise
- """
-
- user = urllib.unquote(user)
- sys.stderr.write("checking permissions for user " + \
- user + " on api " + api_name + "\n")
-
- secret_file = open('/etc/appscale/secret.key', 'r')
- secret = secret_file.read()
- secret = secret[0:-1]
- secret_file.close()
-
- uaserver_file = open('/etc/appscale/hypersoap', 'r')
- uaserver = uaserver_file.read()
- uaserver_file.close()
-
- server = SOAPpy.SOAPProxy("https://" + uaserver + ":4343")
- capabilities = server.get_capabilities(user, secret)
-
- # If a non-existent user was specified this will be ['DB_ERROR', 'no user']
- # instead of a string with their capabilities
- if not isinstance(capabilities, str):
- return False
-
- capabilities = capabilities.split(":")
-
- sys.stderr.write("user " + user + " has the following capabilities: " + \
- str(capabilities) + "\n")
-
- if api_name in capabilities:
- return True
- else:
- return False
-
