components.User Class
Client user mode
Item Index
Methods
- createdAt
- deletedAt
- dispose
- getDomainUsername
- getEmail
- getExternalId
- getFullName
- getOrganisationAdminVisibility
- getOrganisationDomain
- getOrganisationName
- getOrganisationVisibility
- getPersonalVisibility
- getProfileImage
- getUsername
- getVisibilities
- hasVisibility
- isEmailOnly
- isImage
- isSame
- isSoftDeleted
- rel
- save
- toURL
- uniqueId
- updatedAt
- wasCreatedInVicinity
Properties
Methods
createdAt
()
Date
Returns:
deletedAt
()
Date
Returns:
dispose
()
Call when not using this model anymore. Unbinds all event listeners.
getDomainUsername
()
String
Returns:
getEmail
()
String
Returns:
getExternalId
()
String
Returns:
getFullName
()
String
Returns:
getOrganisationAdminVisibility
()
String
Returned in User#getVisibilities() if the user is an organisation admin
Returns:
getOrganisationDomain
()
String
Returns:
getOrganisationName
()
Get human readable organisation name
getOrganisationVisibility
()
String
Returns:
getPersonalVisibility
()
String
Returns:
getProfileImage
()
String
Returns:
url to the profile image
getUsername
()
String
WARNING this is not unique between different organisations in puavo-ticket. Use User#getDomainUsername() when possible.
Returns:
getVisibilities
()
Array
Get visibility strings for the user
Returns:
Array of visibility strings. Eg organisation:testing.opinsys.fi
hasVisibility
-
visibility -
models
Visibility assertion helper
Parameters:
-
visibilityString -
modelsArrayArray of models.server.Visibility models
Returns:
Boolean
isEmailOnly
()
Boolean
Return true for users that have not ever logged in puavo-ticket and have used it only via email
Returns:
isImage
()
Boolean
Return true if the attachment is an image which can be displayed in a
tag
Returns:
isSame
-
other
Return true if the other object is built using the same constructor and they have the same id
Parameters:
-
otherBackbone.Model
Returns:
Boolean
isSoftDeleted
()
Boolean
Returns:
rel
-
key
Return relation data for given key or throw if it's not loaded
Parameters:
-
keyString
Returns:
Relation data
save
()
Bluebird.Promise
Save model to server http://backbonejs.org/#Model-save
Returns:
with the new saved model
toURL
()
String
Return url to this attachment
Returns:
uniqueId
()
String
Returns:
updatedAt
()
Date
Returns:
wasCreatedInVicinity
()
Boolean
Return true if the another model was created within 60 seconds of this one by the same user
Returns:
Properties
idAttribute
String
Use unique_id from models.server.Base as the model id. We need this to be able to put models of diffent type to a single Backbone collection http://backbonejs.org/#Model-idAttribute
saving
Bluebird.Promise | Null
Promise of the saving operation instantiated by Base#save(). Available only when the operation is ongoing.
