Authorization and Permissions

Classes related to authorization and permission management.

class pypgx.api.auth.PermissionEntity(name, authorization_type, java_permission_entity_class)

Bases: object

Class representing an entity which can receive permissions.

Parameters

name (str) –

Return type

None

get_name()

Get the entity name.

Returns

the entity name

Return type

str

get_type()

Get the authorization type.

This indicates if the entity is a user or a role.

Returns

the authorization type

class pypgx.api.auth.PgxResourcePermission(java_resource_permission)

Bases: object

Class representing a type of resource permission.

allows_export()

Check if the resource can be exported.

Returns

Boolean indicating if the resource can be exported.

Return type

bool

allows_inspect()

Check if the resource can be inspected.

Returns

Boolean indicating if the resource can be inspected.

Return type

bool

allows_manage()

Check if the resource can be managed.

Returns

Boolean indicating if the resource can be managed.

Return type

bool

allows_read()

Check if the resource can be read.

Returns

Boolean indicating if the resource can be read.

Return type

bool

allows_write()

Check if the resource can be written.

Returns

Boolean indicating if the resource can be written.

Return type

bool

static get_strongest(a, b)

Return the strongest permission of the two.

Returns

the strongest permission

Return type

pypgx.api.auth._pgx_resource_permission.PgxResourcePermission

class pypgx.api.auth.PgxRole(name)

Bases: pypgx.api.auth._permission_entity.PermissionEntity

Class representing a role for the purposes of permission management.

Parameters

name (str) –

Return type

None

get_name()

Get the entity name.

Returns

the entity name

Return type

str

get_type()

Get the authorization type.

This indicates if the entity is a user or a role.

Returns

the authorization type

class pypgx.api.auth.PgxUser(name)

Bases: pypgx.api.auth._permission_entity.PermissionEntity

Class representing a user for the purposes of permission management.

Parameters

name (str) –

Return type

None

get_name()

Get the entity name.

Returns

the entity name

Return type

str

get_type()

Get the authorization type.

This indicates if the entity is a user or a role.

Returns

the authorization type