From d887d31ad86f9841b86ed28ac64f3e27df6c64fa Mon Sep 17 00:00:00 2001 From: karan Date: Wed, 24 Jan 2024 19:47:29 +0530 Subject: [PATCH] handled role wise access Signed-off-by: karan --- src/common/enums.ts | 3 +- src/components/User/UserDashBoard.tsx | 51 ++++++++++++++++++++------- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/common/enums.ts b/src/common/enums.ts index ea3ab190a..b3ba7021b 100644 --- a/src/common/enums.ts +++ b/src/common/enums.ts @@ -61,7 +61,8 @@ export enum OrganizationRoles { organizationMember = "member", organizationOwner = "owner", organizationIssuer = "issuer", - organizationVerifier = "verifier" + organizationVerifier = "verifier", + organizationAdmin= 'admin' } export enum PlatformRoles { diff --git a/src/components/User/UserDashBoard.tsx b/src/components/User/UserDashBoard.tsx index d250c5be6..c03601d7b 100644 --- a/src/components/User/UserDashBoard.tsx +++ b/src/components/User/UserDashBoard.tsx @@ -461,13 +461,19 @@ const UserDashBoard = () => { return (

What is Schema?

- Schema is a machine-readable semantic -
structure, a predefined data template -
that provides a standard format for the -
digital credential contents. Schemas -
define attributes that are used in one -
or more Credential Definitions. -
Schemas are stored on the ledger. + Schema is a machine-readable semantic +
+ structure, a predefined data template +
+ that provides a standard format for the +
+ digital credential contents. Schemas +
+ define attributes that are used in one +
+ or more Credential Definitions. +
+ Schemas are stored on the ledger.
); }; @@ -729,7 +735,24 @@ const UserDashBoard = () => { onClick={() => { goToOrgSchema(org, org.id, org.roles); }} - className="p-1 rounded-md" + className={`p-1 rounded-md ${ + organizationsList[index].userOrgRoles[0] + .orgRole.name !== + OrganizationRoles.organizationOwner || + organizationsList[index].userOrgRoles[0] + .orgRole.name === + OrganizationRoles.organizationAdmin + ? 'cursor-not-allowed opacity-50' + : '' + }`} + disabled={ + organizationsList[index].userOrgRoles[0] + .orgRole.name !== + OrganizationRoles.organizationOwner || + organizationsList[index].userOrgRoles[0] + .orgRole.name === + OrganizationRoles.organizationAdmin + } > { ) : (
-

You have no organizations created or joined

+

+ You have no organizations created or joined +

)} @@ -960,7 +985,7 @@ const UserDashBoard = () => { ) : (
-

You have no schemas created

+

You have no schemas created

)} @@ -1145,7 +1170,9 @@ const UserDashBoard = () => { ) : (
-

You have no ecosystems created or joined

+

+ You have no ecosystems created or joined +

)} @@ -1230,7 +1257,7 @@ const UserDashBoard = () => { ) : (
-

You have no cred-defs created

+

You have no cred-defs created

)}{' '}