keycloak.authorization.policy

Module Contents

Classes

Policy

A policy defines the conditions that must be satisfied to grant access to an object.

class keycloak.authorization.policy.Policy(name, type, logic, decision_strategy)[source]

A policy defines the conditions that must be satisfied to grant access to an object. Unlike permissions, you do not specify the object being protected but rather the conditions that must be satisfied for access to a given object (for example, resource, scope, or both). Policies are strongly related to the different access control mechanisms (ACMs) that you can use to protect your resources. With policies, you can implement strategies for attribute-based access control (ABAC), role-based access control (RBAC), context-based access control, or any combination of these.

https://keycloak.gitbooks.io/documentation/authorization_services/topics/policy/overview.html

__repr__(self)[source]

Return repr(self).

__str__(self)[source]

Return str(self).

property name(self)[source]
property type(self)[source]
property logic(self)[source]
property decision_strategy(self)[source]
property roles(self)[source]
property permissions(self)[source]
add_role(self, role)[source]

Add keycloak role in policy.

Parameters

role – keycloak role.

Returns

add_permission(self, permission)[source]

Add keycloak permission in policy.

Parameters

permission – keycloak permission.

Returns