Skip to main content

useEntityOwnership()

Home > @backstage/plugin-catalog-react > useEntityOwnership

Returns a function that checks whether the currently signed-in user is an owner of a given entity. When the hook is initially mounted, the loading flag will be true and the results returned from the function will always be false.

Signature:

function useEntityOwnership(): {
loading: boolean;
isOwnedEntity: (entity: Entity) => boolean;
};

Returns:

{ loading: boolean; isOwnedEntity: (entity: Entity) => boolean; }

a function that checks if the signed in user owns an entity