This module contains a class called UserController which provides a controller for User. This class is similar to PLMObjectController but some methods from PLMObjectController are not defined.
Bases: openPLM.plmapp.controllers.base.Controller
Object used to manage a User and store his modification in a history
Attributes : | |
---|---|
Parameters: |
Note
This class does not inherit from PLMObjectController.
alias of UserHistory
Returns a verbose name for attr_name.
Example:
>>> ctrl.get_verbose_name("rank")
u'role in PLM'
Updates object from data of form
This method raises ValueError if form is invalid.
Saves object and records its history in the database. If with_history is False, the history is not recorded.
Permission required: owner
Delegates role role to user.
Raise : | PermissionError if user can not have the role role |
---|---|
Raise : | ValueError if user is object |
Permission required: owner
Removes a delegation (delegation_link). The delegator must be object, otherwise a ValueError is raised.
Adds private file f. f should be a File with an attribute name (like an UploadedFile).
Returns: | the PrivateFile created. |
---|---|
Raises : | PermissionError if _user is not the owner of object |
Raises : | ValueError if the file size is superior to settings.MAX_FILE_SIZE |
Deletes doc_file, the file attached to doc_file is physically removed.
Exceptions raised: | |
---|---|
|
|
Parameters: | doc_file (PrivateFile) – the file to be deleted |
Updates uploaded file informations with data from formset
Parameters: | formset (a modelfactory_formset of ModifyFileForm) – |
---|---|
Raises : | PermissionError if _user is not the owner of object |