mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 08:34:52 +00:00
Update permission logic
This commit is contained in:
@@ -43,17 +43,19 @@ export const SshHostsSection = () => {
|
||||
<div className="mb-4 flex justify-between">
|
||||
<p className="text-xl font-semibold text-mineshaft-100">Hosts</p>
|
||||
<ProjectPermissionCan I={ProjectPermissionActions.Create} a={ProjectPermissionSub.SshHosts}>
|
||||
{(isAllowed) => (
|
||||
<Button
|
||||
colorSchema="primary"
|
||||
type="submit"
|
||||
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
||||
onClick={() => handlePopUpOpen("sshHost")}
|
||||
isDisabled={!isAllowed}
|
||||
>
|
||||
Add Host
|
||||
</Button>
|
||||
)}
|
||||
{(isAllowed) =>
|
||||
isAllowed && (
|
||||
<Button
|
||||
colorSchema="primary"
|
||||
type="submit"
|
||||
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
||||
onClick={() => handlePopUpOpen("sshHost")}
|
||||
isDisabled={!isAllowed}
|
||||
>
|
||||
Add Host
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</ProjectPermissionCan>
|
||||
</div>
|
||||
<SshHostsTable handlePopUpOpen={handlePopUpOpen} />
|
||||
|
||||
Reference in New Issue
Block a user