code: def test_action_store_test_permissions(store: Any, permission: Any):
      client_key = SyftVerifyKey.from_string(
          test_verify_key_string_client
      )
      root_key = SyftVerifyKey.from_string(test_verify_key_string_root)
      hacker_key = SyftVerifyKey.from_string(
          test_verify_key_string_hacker
      )
  
      access = permission(uid=UID(), credentials=client_key)
      access_root = permission(uid=UID(), credentials=root_key)
      access_hacker = permission(uid=UID(), credentials=hacker_key)
  
      # add permission
      store.add_permission(access)
  
      assert store.has_permission(access)
      assert store.has_permission(access_root)
      assert not store.has_permission(access_hacker)
  
      # remove permission
      store.remove_permission(access)
  
      assert not store.has_permission(access)
      assert store.has_permission(access_root)
      assert not store.has_permission(access_hacker)
  
      # take ownership with new UID
      client_uid2 = UID()
      access = permission(uid=client_uid2, credentials=client_key)
  
      store.take_ownership(client_uid2, client_key)
      assert store.has_permission(access)
      assert store.has_permission(access_root)
      assert not store.has_permission(access_hacker)
  
      # delete UID as hacker
      access_hacker_ro = ActionObjectREAD(
          uid=UID(), credentials=hacker_key
      )
      store.add_permission(access_hacker_ro)
  
      res = store.delete(client_uid2, hacker_key)
  
      assert res.is_err()
      assert store.has_permission(access)
      assert store.has_permission(access_hacker_ro)
  
      # delete UID as owner
      res = store.delete(client_uid2, client_key)
      assert res.is_ok()
      assert not store.has_permission(access)
      assert not store.has_permission(access_hacker)
  
file_path: PySyft/packages/syft/tests/syft/stores/action_store_test.py
imports: import sys
  from typing import Any
  import pytest
  from syft.node.credentials import SyftVerifyKey
  from syft.service.action.action_store import ActionObjectEXECUTE
  from syft.service.action.action_store import ActionObjectOWNER
  from syft.service.action.action_store import ActionObjectREAD
  from syft.service.action.action_store import ActionObjectWRITE
  from syft.types.uid import UID
  from .store_constants_test import test_verify_key_string_client
  from .store_constants_test import test_verify_key_string_hacker
  from .store_constants_test import test_verify_key_string_root
  from .store_mocks_test import MockSyftObject
label_desc: Use image node_id 2 for calling a global function with example usage: test_action_store_test_permissions(store, permission) without return types