Skip to content

Interface: CanProps ​

Defined in: packages/sveltekit/src/props.ts:15

Props of <Can>. Conditions are ANDed; without any condition nothing passes (deny by default).

svelte
<Can permission="articles.edit">...</Can>
<Can anyOf={['articles.edit', 'articles.delete']}>
  ...
  {#snippet fallback()}No access{/snippet}
</Can>

Properties ​

PropertyTypeDescriptionDefined in
allOf?NameListPasses with ALL of these permissions.packages/sveltekit/src/props.ts:21
anyOf?NameListPasses with ANY of these permissions.packages/sveltekit/src/props.ts:19
children?Snippet<[]>-packages/sveltekit/src/props.ts:24
fallback?Snippet<[]>Rendered when the check fails.packages/sveltekit/src/props.ts:26
not?booleanInvert the check (render children when the user does NOT have the permissions).packages/sveltekit/src/props.ts:23
permission?NameListThe permission, or a list of permissions that are ALL required.packages/sveltekit/src/props.ts:17

Released under the MIT License. Inspired by spatie/laravel-permission.