[ARVADOS-WORKBENCH2] updated: 2.3.0-44-ga3658215

Git user git at public.arvados.org
Wed Dec 1 00:21:00 UTC 2021


Summary of changes:
 src/views-components/data-explorer/renderers.tsx | 25 +++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

       via  a3658215b1129e78e2dfd7496e1d5de8263b2351 (commit)
      from  416d4f0f57336b2225bcc82b0f4db8873adf8cd2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a3658215b1129e78e2dfd7496e1d5de8263b2351
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Nov 30 19:20:27 2021 -0500

    18123: Disable delete group link if user lacks permission.
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 39893392..457de504 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -403,13 +403,19 @@ export const ResourceLinkTailUuid = connect(
         return tailResource || { uuid: '' };
     })(renderUuid);
 
-const renderLinkDelete = (dispatch: Dispatch, item: LinkResource) => {
+const renderLinkDelete = (dispatch: Dispatch, item: LinkResource, canManage: boolean) => {
     if (item.uuid) {
-        return <Typography noWrap>
-            <IconButton data-cy="resource-delete-button" onClick={() => dispatch<any>(openRemoveGroupMemberDialog(item.uuid))}>
-                <RemoveIcon />
-            </IconButton>
-        </Typography>;
+        return canManage ?
+            <Typography noWrap>
+                <IconButton data-cy="resource-delete-button" onClick={() => dispatch<any>(openRemoveGroupMemberDialog(item.uuid))}>
+                    <RemoveIcon />
+                </IconButton>
+            </Typography> :
+            <Typography noWrap>
+                <IconButton disabled data-cy="resource-delete-button">
+                    <RemoveIcon />
+                </IconButton>
+            </Typography>;
     } else {
       return <Typography noWrap></Typography>;
     }
@@ -419,10 +425,11 @@ export const ResourceLinkDelete = connect(
     (state: RootState, props: { uuid: string }) => {
         const link = getResource<LinkResource>(props.uuid)(state.resources);
         return {
-            item: link || { uuid: '', kind: ResourceKind.NONE }
+            item: link || { uuid: '', kind: ResourceKind.NONE },
+            canManage: link && getResourceLinkCanManage(state, link),
         };
-    })((props: { item: LinkResource } & DispatchProp<any>) =>
-      renderLinkDelete(props.dispatch, props.item));
+    })((props: { item: LinkResource, canManage: boolean } & DispatchProp<any>) =>
+      renderLinkDelete(props.dispatch, props.item, props.canManage));
 
 export const ResourceLinkTailEmail = connect(
     (state: RootState, props: { uuid: string }) => {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list