diff --git a/pkg/interface/src/views/apps/links/LinkResource.tsx b/pkg/interface/src/views/apps/links/LinkResource.tsx index e2158d577..8704bbcbf 100644 --- a/pkg/interface/src/views/apps/links/LinkResource.tsx +++ b/pkg/interface/src/views/apps/links/LinkResource.tsx @@ -48,6 +48,7 @@ export function LinkResource(props: LinkResourceProps) { ? associations.graph[appPath] : { metadata: {} }; const contactDetails = contacts[resource["group-path"]] || {}; + const group = groups[resource["group-path"]] || {}; const graph = graphs[resourcePath] || null; useEffect(() => { @@ -83,6 +84,7 @@ export function LinkResource(props: LinkResourceProps) { hideNicknames={hideNicknames} baseUrl={resourceUrl} color={uxToHex(contact?.color || '0x0')} + group={group} api={api} /> ); diff --git a/pkg/interface/src/views/apps/links/components/link-item.js b/pkg/interface/src/views/apps/links/components/link-item.js index a803b8d98..0d7d777f0 100644 --- a/pkg/interface/src/views/apps/links/components/link-item.js +++ b/pkg/interface/src/views/apps/links/components/link-item.js @@ -5,6 +5,8 @@ import { Sigil } from '~/logic/lib/sigil'; import { Link } from 'react-router-dom'; import { cite } from '~/logic/lib/util'; +import { roleForShip } from "~/logic/lib/group"; + export const LinkItem = (props) => { const { node, @@ -14,7 +16,8 @@ export const LinkItem = (props) => { resource, hideAvatars, hideNicknames, - api + api, + group } = props; const URLparser = new RegExp( @@ -36,6 +39,7 @@ export const LinkItem = (props) => { const baseUrl = props.baseUrl || `/~404/${resource}`; + const ourRole = group ? roleForShip(group, window.ship) : undefined; const [ship, name] = resource.split("/"); return ( @@ -61,7 +65,7 @@ export const LinkItem = (props) => { {size} comments - {(author === window.ship) && api.graph.removeNodes(`~${ship}`, name, [node.post.index])}>Delete} + {(ourRole === "admin") && api.graph.removeNodes(`~${ship}`, name, [node.post.index])}>Delete}