# Encountering \`Shared Object Operation Not Allowed\` Error When Accessing Shared Object on contract level

**URL:** <https://forums.sui.io/t/encountering-shared-object-operation-not-allowed-error-when-accessing-shared-object-on-contract-level/47383>\
**Category:** Technical Support\
**Tags:** move\
**Created:** [February 11, 2025, 9:29pm UTC](https://forums.sui.io/t/encountering-shared-object-operation-not-allowed-error-when-accessing-shared-object-on-contract-level/47383 "2025-02-11T21:29:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahlil](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/tahlil/32/30688_2.png) [@tahlil](https://forums.sui.io/u/tahlil)\
**Post date:** [February 11, 2025, 9:29pm UTC](https://forums.sui.io/t/encountering-shared-object-operation-not-allowed-error-when-accessing-shared-object-on-contract-level/47383/1 "2025-02-11T21:29:53Z")

</div>

Trying to access details of a shared object on a contract level I am getting following error `SharedObjectOperationNotAllowed`:  
This is the contact level code:

```auto
public fun get_x_types(
        xs: &vector<X>
    ): vector<u8> {
        let mut list_types = vector::empty<u8>();
        let mut i = 0;
        while (vector::length(xs) > i) {
            let x_details = &xs[i];
            let mut xtype: u8 = 9;
            if(&x_details.x_type == XType::hh) {
                xtype = 0;
            } else if(&x_details.x_type == XType::aa) {
                xtype = 1;
            };
            vector::push_back(&mut list_types, xtype);
            i = i + 1;
        };
        list_types
    }

```

This is the frontend code:

```auto
const tx = new Transaction();
tx.moveCall({
  target: `${UPGRADED_PACKAGE_ADDRESS}::collections::get_x_types`, 
  arguments: [
    tx.makeMoveVec({ elements: xEngineIds }) 
  ],
});
const res = await suiClient.devInspectTransactionBlock({
  transactionBlock: tx,
  sender: account?.address + "",
});

```

Why I am not allowed to access the data of the shared objects? I only want to get the related data of the shared objects not mutate it?
