utils.leanix_user
Class to represent a LeanIX user. Used for quality management calculations and subscription handling.
Wrapper for standard python get()
function for users. Gets a user attribute or returns a default value.
Returns all users, after making sure they have all been loaded from LeanIX.
Set options
to {"force_refresh": True}
to refresh the users cache from LeanIX first.
Finds users by workspace role.
Set force_refresh = True
to refresh the users cache from LeanIX first.
Example:
admins = LeanIXUser.find_by_role("ADMIN")
Finds user by displayName
. Checks for exact match and returns the first matching user.
Set force_refresh = True
to refresh the users cache from LeanIX first.
Example:
john = LeanIXUser.find("John Doe")
Finds user by email
address. Checks for exact match and returns the first matching user.
force_refresh
parameter is deprecated.
Example:
john = LeanIXUser.find_by_email("john.doe@example.com")
Finds user by id
.
Parameter force_refresh
is not used at the moment, since we load the user directly from the API and not from cache.
Example:
john = LeanIXUser.find_by_id("fac7f0a6-88be-49fd-8935-1fde3edd335d")
Returns all subscriptions of a user. Subscriptions are loaded along with each fact sheet, so you should run Application.all() or FactSheet.all() before using .get_subscriptions(), or otherwise you will get an empty result.