gws.plugin.model_field.integer

Integer field.

Source code: gws.plugin.model_field.integer

Package Contents

class gws.plugin.model_field.integer.Config

Bases: gws.base.model.scalar_field.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

Bases: gws.base.model.scalar_field.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 or 0 if the user’s permissions have the bit and None 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.

can_create(obj: Object, *context) bool

Check if the user has “create” permission on an object.

can_delete(obj: Object, *context) bool

Check if the user has “delete” permission on an object.

can_edit(obj: Object, *context) bool

Check if the user has “edit” permissions on an object.

can_read(obj: Object, *context) bool

Check if the user has “read” permission on an object.

can_use(obj: Object, *context) bool

Check if the user has “read” permission on an object.

can_write(obj: Object, *context) bool

Check if the user has “write” permission on an object.

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.

require_layer(uid=None) Layer

Get a readable Layer object.

Parameters:

uid – Layer uid.

Returns:

A Layer object.

require_project(uid: str = None) Project

Get a readable Project object.

Parameters:

uid – Project uid.

Returns:

A Project object.