Commit dde90b26 authored by Amos Latteier's avatar Amos Latteier

updated the User API, as per Brian Lloyd's request

parent 4ffa7ebb
...@@ -89,54 +89,55 @@ class AuthenticatedUser: ...@@ -89,54 +89,55 @@ class AuthenticatedUser:
are returned by user validation and used for access control. are returned by user validation and used for access control.
""" """
def getUserName(): def getUserName():
""" """
Return the name of a user Return the name of a user
Permission -- Always available Permission -- Always available
"""
def has_role(roles, object=None):
""" """
Return true if the user has at least one role from a list of
roles, optionally in the context of an object.
def hasRole(object, roles): Permission -- Always available
""" """
Return a value that is true if the user has the given roles on def has_permission(permission, object):
the given object and return false otherwise. """
Return true if the user has a permission on an object.
Permission -- Always available Permission -- Always available
"""
def getRoles():
""" """
Return a list of the user's roles.
def getRoles(object): Permission -- Always available
""" """
Returns a list of the roles the user has on the given object def getRolesInContext(object):
(in the current context?) """
Return the list of roles assigned to the user, including local
roles assigned in context of an object.
Permission -- Always available Permission -- Always available
""" """
def getId(): def getId():
""" """
Get the ID of the user. The ID can be used from
Python to get the user from the user's UserDatabase.
Get the ID of the user. The ID can be used, at least from Permission -- Always available
Python, to get the user from the user's UserDatabase.
Permission -- Python only
""" """
def getDatabasePath(): def getDomains():
""" """
Return the list of domain restrictions for a user.
Get a physical path to the user's UserDatabase. A Traversal Permission -- Always available
facility can be used to get the user database from the path
returned by this method.
Permission -- Python only
""" """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment