Spaces:
Runtime error
Runtime error
Download ui/src/access.ts from shancode/py-server-demo: direct link, hf CLI and curl.
- Browser
- Download file 283 Bytes
-
https://huggingface.co/spaces/shancode/py-server-demo/resolve/main/ui/src/access.ts
- Command line
-
hf download hf://spaces/shancode/py-server-demo/ui/src/access.ts
-
curl -L -o access.ts https://huggingface.co/spaces/shancode/py-server-demo/resolve/main/ui/src/access.ts
283 Bytes
| /** | |
| * @see https://umijs.org/docs/max/access#access | |
| * */ | |
| export default function access( | |
| initialState: { currentUser?: API.CurrentUser } | undefined, | |
| ) { | |
| const { currentUser } = initialState ?? {}; | |
| return { | |
| canAdmin: currentUser && currentUser.access === 'admin', | |
| }; | |
| } | |