gws.plugin.model_field.integer
¶
Integer field.
Source code: gws.plugin.model_field.integer
Package Contents¶
- class gws.plugin.model_field.integer.Config¶
- class gws.plugin.model_field.integer.Object¶
Bases:
gws.base.model.scalar_field.Object
- attributeType¶
- configure_widget()¶
- convert(val, mc)¶
- class gws.plugin.model_field.integer.Props¶
- class gws.plugin.model_field.integer.User¶
Bases:
Object
User object.
- attributes: dict¶
Public user attributes.
- authProvider: AuthProvider¶
User authorization provider.
- authToken: str¶
Token used for authorization.
- data: dict¶
Private user data.
- displayName: str¶
User display name.
- email: str¶
User email.
- isGuest: bool¶
User is a Guest.
- localUid: str¶
User uid within its authorization provider.
- loginName: str¶
User login name.
- mfaSecret: str¶
MFA secret.
- mfaUid: str¶
MFA adapter uid.
- roles: set[str]¶
User roles.
- uid: str¶
Global user uid.
- acl_bit(access: Access, obj: Object) int | None ¶
Get the ACL bit for a specific object.
- Parameters:
access – Access mode.
obj – Requested object.
- Returns:
1
or0
if the user’s permissions have the bit andNone
otherwise.
- acquire(uid: str = None, classref: ClassRef | None = None, access: Access | None = None) Object | None ¶
Get a readable object by uid.
- Parameters:
uid – Object uid.
classref – Class reference. If provided, ensures that the object matches the reference.
access – Access mode, assumed
Access.read
if omitted.
- Returns:
A readable object or
None
if the object does not exists or user doesn’t have a permission.
- can(access: Access, obj: Object, *context) bool ¶
Check if the user can access an object.
- Parameters:
access – Access mode.
obj – Requested object.
*context – Further objects to check.
- Returns:
True
is access is granted.
- require(uid: str = None, classref: ClassRef | None = None, access: Access | None = None) Object ¶
Get a readable object by uid and fail if not found.
- Parameters:
uid – Object uid.
classref – Class reference. If provided, ensures that the object matches the reference.
access – Access mode, assumed
Access.read
if omitted.
- Returns:
A readable object.
- Raises:
NotFoundError if the object doesn't exist. –
ForbiddenError if the user cannot read the object. –