|
| 1 | +export function Conditionals({ |
| 2 | + hasImpersonationRead, |
| 3 | + hasMagicLinksCreate, |
| 4 | + hasMagicLinksRead, |
| 5 | + hasImpersonationManage, |
| 6 | + hasAdminRole, |
| 7 | + hasManagerRole, |
| 8 | + hasImpersonationReaderRole, |
| 9 | + role, |
| 10 | + hasImpersonationFeature, |
| 11 | + hasMagicLinksFeature, |
| 12 | +}: { |
| 13 | + hasImpersonationRead: boolean; |
| 14 | + hasMagicLinksCreate: boolean; |
| 15 | + hasMagicLinksRead: boolean; |
| 16 | + hasImpersonationManage: boolean; |
| 17 | + hasAdminRole: boolean; |
| 18 | + hasManagerRole: boolean; |
| 19 | + hasImpersonationReaderRole: boolean; |
| 20 | + role: string | null | undefined; |
| 21 | + hasImpersonationFeature: boolean; |
| 22 | + hasMagicLinksFeature: boolean; |
| 23 | +}) { |
| 24 | + return ( |
| 25 | + <> |
| 26 | + <pre> |
| 27 | + {`has({ permission: "org:impersonation:read" }) -> `} |
| 28 | + {hasImpersonationRead ? 'true' : 'false'} |
| 29 | + </pre> |
| 30 | + |
| 31 | + <pre> |
| 32 | + {`has({ permission: "org:magic_links:create" }) -> `} |
| 33 | + {hasMagicLinksCreate ? 'true' : 'false'} |
| 34 | + </pre> |
| 35 | + |
| 36 | + <pre> |
| 37 | + {`has({ permission: "org:magic_links:read" }) -> `} |
| 38 | + {hasMagicLinksRead ? 'true' : 'false'} |
| 39 | + </pre> |
| 40 | + |
| 41 | + <pre> |
| 42 | + {`has({ permission: "org:impersonation:manage" }) -> `} |
| 43 | + {hasImpersonationManage ? 'true' : 'false'} |
| 44 | + </pre> |
| 45 | + |
| 46 | + <pre> |
| 47 | + {`has({ role: "org:admin" }) -> `} |
| 48 | + {hasAdminRole ? 'true' : 'false'} |
| 49 | + </pre> |
| 50 | + |
| 51 | + <pre> |
| 52 | + {`has({ role: "org:manager" }) -> `} |
| 53 | + {hasManagerRole ? 'true' : 'false'} |
| 54 | + </pre> |
| 55 | + |
| 56 | + <pre> |
| 57 | + {`has({ role: "org:impersonation_reader" }) -> `} |
| 58 | + {hasImpersonationReaderRole ? 'true' : 'false'} |
| 59 | + </pre> |
| 60 | + |
| 61 | + <pre> |
| 62 | + {`role -> `} |
| 63 | + {role} |
| 64 | + </pre> |
| 65 | + |
| 66 | + <pre> |
| 67 | + {`has({ feature: "org:impersonation" }) -> `} |
| 68 | + {hasImpersonationFeature ? 'true' : 'false'} |
| 69 | + </pre> |
| 70 | + |
| 71 | + <pre> |
| 72 | + {`has({ feature: "org:magic_links" }) -> `} |
| 73 | + {hasMagicLinksFeature ? 'true' : 'false'} |
| 74 | + </pre> |
| 75 | + </> |
| 76 | + ); |
| 77 | +} |
0 commit comments