Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions skills/objectui/guides/auth-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ const dataSource = new ObjectStackAdapter({

### PermissionProvider setup

<!-- os:check -->
```typescript
import { PermissionProvider } from '@object-ui/permissions';
import { useAuth } from '@object-ui/auth';
import type { ObjectPermissionConfig, RoleDefinition } from '@object-ui/types';
declare function AppContent(): null; // stands in for your own app tree

// A role definition carries identity and inheritance only. Its grants live in
// `ObjectPermissionConfig.roles` below, keyed by object — that is the single
Expand Down Expand Up @@ -186,8 +189,8 @@ function App() {
<PermissionProvider
roles={roles}
permissions={permissions}
userRoles={user?.roles || ['viewer']}
user={user}
userRoles={user?.positions || ['viewer']}
user={user ?? undefined}
>
<AppContent />
</PermissionProvider>
Expand Down