- {(text || owner) && (
-
- )}
-
-
-
+ <>
+
+ {(text || owner) && (
+
+ )}
+
+
+
+
+
+
-
-
- >
+ >
+
)
}
diff --git a/src/pages/asset/index.tsx b/src/pages/asset/index.tsx
index 61d335698..025602a3c 100644
--- a/src/pages/asset/index.tsx
+++ b/src/pages/asset/index.tsx
@@ -1,4 +1,5 @@
import React, { ReactElement, useEffect, useState } from 'react'
+import Permission from '../../components/organisms/Permission'
import { PageProps } from 'gatsby'
import PageTemplateAssetDetails from '../../components/templates/PageAssetDetails'
import AssetProvider from '../../providers/Asset'
@@ -11,8 +12,10 @@ export default function PageGatsbyAssetDetails(props: PageProps): ReactElement {
}, [props.location.pathname])
return (
-
-
-
+
+
+
+
+
)
}
diff --git a/src/utils/rbac.ts b/src/utils/rbac.ts
new file mode 100644
index 000000000..80b08e4f5
--- /dev/null
+++ b/src/utils/rbac.ts
@@ -0,0 +1,34 @@
+import fetch from 'cross-fetch'
+import appConfig from '../../app.config'
+
+export default async function rbacRequest(
+ eventType: string,
+ address: string
+): Promise
{
+ const url = appConfig.rbacUrl
+ if (url === undefined) {
+ return true
+ } else {
+ const data = {
+ component: 'market',
+ eventType,
+ authService: 'address',
+ credentials: {
+ address
+ }
+ }
+ try {
+ const response = await fetch(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(data)
+ })
+ return await response.json()
+ } catch (error) {
+ console.error('Error parsing json: ' + error.message)
+ return 'ERROR'
+ }
+ }
+}