allura.model.auth

class allura.model.auth.User
property activity_extras

Return a BSON-serializable dict of extra stuff to store on the activity.

property activity_name

Override this for each Artifact type.

can_send_user_message()

Return true if User is permitted to send a mesage to another user.

Returns False if User has exceeded the user message rate limit, in which case another message may not be sent until sufficient time has passed to clear the limit.

index()

Return a dict representation of this object suitable for search indexing.

Subclasses should implement this, providing a dictionary of solr_field => value. These fields & values will be stored by Solr. Subclasses should call the super().index() and then extend it with more fields.

You probably want to override at least title and text to have meaningful search results and email senders.

You can take advantage of Solr’s dynamic field typing by adding a type suffix to your field names, e.g.:

_s (string) (not analyzed) _t (text) (analyzed) _b (bool) _i (int) _f (float) _dt (datetime)

my_projects_by_role_name(role_name)

Return only projects for which user has that role.

private_project()

Returns the personal user-project for the user

send_user_mention_notification(mentioned_by, artifact)

Send user mention notification to {self} user.

send_user_message(user, subject, message, cc, reply_to_real_address, sender_email_address)

Send a user message (email) to user.

should_update_index(old_doc, new_doc)

Determines if solr index should be updated.

Values passed as old_doc and new_doc are original and modified versions of same object, represented as dictionaries.

time_to_next_user_message()

Return a timedelta of the time remaining before this user can send another user message.

Returns zero if user message can be sent immediately.

url()

Return the URL (relative to root domain) for this user’s user-project. This includes any special handling via the AuthenticationProvider to determine the proper user-project name

class allura.model.auth.ProjectRole

The roles that a single user holds in a project. Also the named roles (called “Groups” in the UI) are in this model (and can include other named roles)

Variables:
  • user_id – used if this role is for a single user. Empty for named roles

  • project_id – the project id

  • name – named roles (like Admin, Developer, custom-names-too)

  • roles – a list of other ProjectRole ObjectId values which this user/group has access to

class allura.model.auth.AuditLog