# How to disable Copy and Paste dashboard option to Guest user

**URL:** <https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [June 26, 2023, 6:18pm UTC](https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199 "2023-06-26T18:18:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohan\_Pathapataa](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/mohan_pathapataa/32/11730_2.png) [@Mohan\_Pathapataa](https://community.cumulocity.com/u/Mohan_Pathapataa)\
**Post date:** [June 26, 2023, 6:18pm UTC](https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199/1 "2023-06-26T18:18:59Z")

</div>

#### _ **Product/components** used and **version/fix** level:_

Cumulocity Production

#### _Detailed explanation of the problem:_

I have cloned a custom cockpit application with version: **1015.0.249**

We have a two users Admin and Guest. We need to disable copy and paste dashboard option to the guest user, which has only a reader access or not having admin access.

can we disable the copy and paste dashboard option based on the roles ?

#### _Error messages / **full error** message screenshot / **log** file:_

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/d/5/d5c527399a3a68e7a9b99c92b8b7a5b95a404b4a.png)

Regards  
Mohan

---

<div class="post-metadata">

**Author:** ![Mohan\_Pathapataa](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/mohan_pathapataa/32/11730_2.png) [@Mohan\_Pathapataa](https://community.cumulocity.com/u/Mohan_Pathapataa)\
**Post date:** [July 3, 2023, 5:11pm UTC](https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199/2 "2023-07-03T17:11:36Z")

</div>

Any inputs on this ?

Regards  
Mohan

---

<div class="post-metadata">

**Author:** ![Tristan\_Bastian](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/tristan_bastian/32/18259_2.png) [@Tristan\_Bastian](https://community.cumulocity.com/u/Tristan_Bastian)\
**Post date:** [July 4, 2023, 7:12am UTC](https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199/3 "2023-07-04T07:12:25Z")

</div>

Hi Mohan,

in general the `Copy dashboard` functionality was not designed in a way to be removable.

You could try removing it by filtering the `items$` of the [ActionBarService](https://resources.cumulocity.com/documentation/websdk/ngx-components/injectables/ActionBarService.html).

I’ve been e.g. able to remove the `Copy dashboard` button by using:

```auto
import { Injectable, Injector } from '@angular/core';
import { Router } from '@angular/router';
import { ActionBarService } from '@c8y/ngx-components';
import { map } from 'rxjs/operators';

@Injectable({ providedIn: 'root' })
export class CustomActionBarService extends ActionBarService {
  constructor(rootInjector: Injector, router: Router) {
    super(rootInjector, router);

    this.items$ = this.items$.pipe(
      map(items => {
        return items.filter(item => item.placement !== 'more' || item.priority !== -2000);
      })
    );
  }
}

```

and overriding the original ActionBarService with our custom implementation, by adding this to the providers of the app.module.ts:

```auto
providers: [{ provide: ActionBarService, useClass: CustomActionBarService }]

```

There is sadly no unique identifier to specifically identify the `Copy dashboard` ActionBarItem… Using the filter from above could potentially remove also other items in the `more` menu of the action bar, which use the same priority. So you might want to double check that you are not removing further items.

The above sample removes the `Copy dashboard` item completely, but you should be able to adapt this in case you only want to do this under certain conditions.

Similar procedures should also apply for e.g. the left navigation, the tabs and probably also further extension points.

Regards,  
Tristan

---

<div class="post-metadata">

**Author:** ![Mohan\_Pathapataa](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/mohan_pathapataa/32/11730_2.png) [@Mohan\_Pathapataa](https://community.cumulocity.com/u/Mohan_Pathapataa)\
**Post date:** [July 5, 2023, 2:30pm UTC](https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199/4 "2023-07-05T14:30:03Z")

</div>

Okay ! Thanks for the update Tristan

Regards  
Mohan

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [January 1, 2024, 2:30pm UTC](https://community.cumulocity.com/t/how-to-disable-copy-and-paste-dashboard-option-to-guest-user/1199/5 "2024-01-01T14:30:28Z")

</div>

Closed on January 1, 2024, 2:30pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
