Skip to main content

@backstage/plugin-permission-common

Home > @backstage/plugin-permission-common

Isomorphic types and client for Backstage permissions and authorization

Classes

ClassDescription
PermissionClientAn isomorphic client for requesting authorization for Backstage permissions.

Enumerations

EnumerationDescription
AuthorizeResultThe result of an authorization request.

Functions

FunctionDescription
createPermission(input)Utility function for creating a valid ResourcePermission, inferring the appropriate type and resource type parameter.
createPermission(input)Utility function for creating a valid BasicPermission.
isCreatePermission(permission)Check if a given permission is related to a create action.
isDeletePermission(permission)Check if a given permission is related to a delete action.
isPermission(permission, comparedPermission)Check if the two parameters are equivalent permissions.
isReadPermission(permission)Check if a given permission is related to a read action.
isResourcePermission(permission, resourceType)Check if a given permission is a ResourcePermission. When resourceType is supplied as the second parameter, also checks if the permission has the specified resource type.
isUpdatePermission(permission)Check if a given permission is related to an update action.
toPermissionEvaluator(permissionAuthorizer)Convert PermissionAuthorizer to PermissionEvaluator.

Interfaces

InterfaceDescription
PermissionAuthorizerA client interacting with the permission backend can implement this authorizer interface.
PermissionEvaluatorA client interacting with the permission backend can implement this evaluator interface.

Type Aliases

Type AliasDescription
AllOfCriteriaRepresents a logical AND for the provided criteria.
AnyOfCriteriaRepresents a logical OR for the provided criteria.
AuthorizePermissionRequestRequest object for PermissionEvaluator.authorize(). If a ResourcePermission is provided, it must include a corresponding resourceRef.
AuthorizePermissionResponseResponse object for PermissionEvaluator.authorize().
AuthorizeRequestOptionsOptions for authorization requests.
BasicPermissionA standard Permission with no additional capabilities or restrictions.
ConditionalPolicyDecisionA conditional decision returned by the PermissionPolicy.
DefinitivePolicyDecisionA definitive decision returned by the PermissionPolicy.
DiscoveryApiThis is a copy of the core DiscoveryApi, to avoid importing core.
EvaluatePermissionRequestAn individual request sent to the permission backend.
EvaluatePermissionRequestBatchA batch of requests sent to the permission backend.
EvaluatePermissionResponseAn individual response from the permission backend.
EvaluatePermissionResponseBatchA batch of responses from the permission backend.
EvaluatorRequestOptionsOptions for PermissionEvaluator requests.
IdentifiedPermissionMessageA request with a UUID identifier, so that batched responses can be matched up with the original requests.
NotCriteriaRepresents a negation of the provided criteria.
PermissionA permission that can be checked through authorization.
PermissionAttributesThe attributes related to a given permission; these should be generic and widely applicable to all permissions in the system.
PermissionBaseGeneric type for building Permission types.
PermissionCondition

A condition returned with a CONDITIONAL authorization response.

Conditions are a reference to a rule defined by a plugin, and parameters to apply the rule. For example, a rule might be isOwner from the catalog-backend, and params may be a list of entity claims from a identity token.

PermissionCriteriaComposes several PermissionConditions as criteria with a nested AND/OR structure.
PermissionMessageBatchA batch of request or response items.
PermissionRuleParamA parameter to a permission rule.
PermissionRuleParamsTypes that can be used as parameters to permission rules.
PolicyDecisionA decision returned by the PermissionPolicy.
QueryPermissionRequestRequest object for PermissionEvaluator.authorizeConditional().
QueryPermissionResponseResponse object for PermissionEvaluator.authorizeConditional().
ResourcePermissionResourcePermissions are Permissions that can be authorized based on characteristics of a resource such a catalog entity.