and clear session when password is changed. The sessions are checked using on a fix maximum age of 30 days using the create_date value. The write_date is updated as long as the delay of the last update is not bigger than the session timeout. RPC can request a fresh session. A fresh session is a session that was updated last time before the session timeout. If it is not the case, the session is deleted and a request to create a new session is sent to the client. All the sessions of the users for which the password has been changed are also deleted in order to ensure that stolen session can no more be used. We use this new feature for set_preferences of user instead of duplicate the login mechanism. issue7568 review53331002
38 lines
808 B
ReStructuredText
38 lines
808 B
ReStructuredText
.. _ref-rpc:
|
|
.. module:: trytond.rpc
|
|
|
|
===
|
|
RPC
|
|
===
|
|
|
|
.. class:: RPC([readonly[, instantiate[, result[, check_access[, unique[, fresh_session]]]]]])
|
|
|
|
RPC is an object to define the behavior of Remote Procedur Call.
|
|
|
|
Instance attributes are:
|
|
|
|
.. attribute:: RPC.readonly
|
|
|
|
The transaction mode
|
|
|
|
.. attribute:: RPC.instantiate
|
|
|
|
The position or the slice of the argument to be instanciated
|
|
|
|
.. attribute:: RPC.result
|
|
|
|
The function to transform the result
|
|
|
|
.. attribute:: RPC.check_access
|
|
|
|
Set `_check_access` in the context to activate the access right on model
|
|
and field. Default is `True`.
|
|
|
|
.. attribute:: RPC.unique
|
|
|
|
If set, it ensures the instantiated records are unique. Default is `True`.
|
|
|
|
.. attribute:: RPC.fresh_session
|
|
|
|
If set, it requires a fresh session. Default is `False`.
|