lavocatt commented on code in PR #35:
URL: 
https://github.com/apache/activemq-artemis-console/pull/35#discussion_r1853643629


##########
artemis-console-extension/artemis-extension/src/artemis-extension/artemis/artemis-service.ts:
##########
@@ -589,6 +595,20 @@ class ArtemisService {
     checkCanBrowseQueue = (queueMBean: MBeanNode ): boolean => {
         return (this.DEBUG_PRIVS && queueMBean?.hasInvokeRights(BROWSE_SIG)) 
?? false;
     }
+
+    doesCopyMessageMethodExist = (broker: MBeanNode | undefined, queue: 
string): boolean => {
+        return this.doesMethodExist(broker, queue, COPY_MESSAGE_SIG);
+    }
+
+    doesMethodExist = (broker: MBeanNode | undefined, queue: string, method: 
string): boolean => {
+        if(broker) {
+            var queueMBean = broker.parent?.find(node => { 
+                return node.propertyList?.get('subcomponent') === 'queues' && 
node.name === queue 
+            })
+            return queueMBean?queueMBean.hasOperations(method): false;
+        }
+        return false;
+    }

Review Comment:
   Could there be a situation where there are several `queueMBean` validating 
the condition in the find? If so, I would change the find to a filter and try 
to find the operation in at least one of them.
   If not, ignore this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to