The user_role
module provides the backend functionality for dealing with
User
that have are linked to a Part
via the
UserPartRole
.
Routes are defined in init()
.
-
class
wte.views.user_role.
ActionSchema
(*args, **kw)[source]
- The
ActionSchema
handles the
- validation of a actions applied in
action()
and
update()
.
Messages
badDictType
:
- The input must be dict-like (not a
%(type)s
: %(value)r
)
badType
:
- The input must be a string (not a
%(type)s
: %(value)r
)
empty
:
- Please enter a value
missingValue
:
- Missing value
noneType
:
- The input must be a string (not None)
notExpected
:
- The input field
%(name)s
was not expected.
singleValueExpected
:
- Please provide only one value
-
action
= None
The action to apply
-
role_id
= None
The list of UserPartRole
to apply the action to
-
class
wte.views.user_role.
AddUserSchema
(*args, **kw)[source]
- The
AddUserSchema
handles the
- validation of a adding a
User
to a
Part
..
Messages
badDictType
:
- The input must be dict-like (not a
%(type)s
: %(value)r
)
badType
:
- The input must be a string (not a
%(type)s
: %(value)r
)
empty
:
- Please enter a value
missingValue
:
- Missing value
noneType
:
- The input must be a string (not None)
notExpected
:
- The input field
%(name)s
was not expected.
singleValueExpected
:
- Please provide only one value
-
q
= None
Save the query in case there are validation errors
-
role
= None
The new role for the User
-
start
= None
Save the pagination in case there are validation errors
-
user_id
= None
The id of the User
to add
-
class
wte.views.user_role.
ChangeRoleSchema
(*args, **kw)[source]
- The
ChangeRoleSchema
handles the
- validation of a “change_role” action applied in
update()
.
Messages
badDictType
:
- The input must be dict-like (not a
%(type)s
: %(value)r
)
badType
:
- The input must be a string (not a
%(type)s
: %(value)r
)
empty
:
- Please enter a value
missingValue
:
- Missing value
noneType
:
- The input must be a string (not None)
notExpected
:
- The input field
%(name)s
was not expected.
singleValueExpected
:
- Please provide only one value
-
action
= None
The action to apply
-
q
= None
Optional query parameter for the redirect
-
role
= None
The new role
-
role_id
= None
The list of UserPartRole
to apply the action to
-
start
= None
Optional start parameter for the redirect
-
wte.views.user_role.
action
(request)[source]
Handles the parts/{pid}/users/action
URL, loads the interface for changing
User
registered for a Part
.
Requires that the user has “users” rights on the
Part
.
-
wte.views.user_role.
add
(request)[source]
Handles the parts/{pid}/users/add
URL, providing the functionality for adding a
User
to a Part
.
Requires that the user has “users” rights on the
Part
.
-
wte.views.user_role.
init
(config)[source]
Adds the user-part-role-specific backend routes (route name, URL pattern
handler):
part.users
– /parts/{pid}/users
– users()
part.users.action
– /parts/{pid}/users/action
– action()
part.users.update
– /parts/{pid}/users/update
– update()
part.users.add
– /parts/{pid}/users/add
– add()
-
wte.views.user_role.
update
(request)[source]
Handles the parts/{pid}/users
URL, applying the changes select when the
user views action()
.
Requires that the user has “users” rights on the
Part
.
-
wte.views.user_role.
users
(request)[source]
Handles the parts/{pid}/users
URL, displaying the
User
registered for a Part
.
Requires that the user has “users” rights on the
Part
.