Policy

class PolicyEndpoint(req_handler)
task items()

List the policies on the server.

Returns:set – Policy names
task read(name)

Read a single policy.

Parameters:name (str) – The policy name
Returns:Rules – The rules
task write(name, rules)

Sets rules to the given name.

Once a policy is updated, it takes effect immediately to all associated users.

Parameters:
  • name (str) – The policy name
  • rules (dict) – The rules.
Returns:

bool – Rules has been written

task delete(name)

Delete the rules with the given name.

This will immediately affect all associated users. When a user is associated with a policy that doesn’t exist, it is identical to not being associated with that policy.

Parameters:name (str) – The policy name
Returns:bool – Policy does not exists in storage
task write_path(name, path, policy)

Set one rule to a given policy

Parameters:
  • name (str) – The policy name
  • path (str) – The path
  • policy (str) – The policy
Returns:

bool – Path has been written

task delete_path(name, path)

Delete one rule from a given policy

Parameters:
  • name (str) – The policy name
  • path (str) – The path
Returns:

bool – Path has been deleted from policy

Objects

class Rules(*, name, rules=None)