---
schema_version: "1"
id: 7c6969d0a98966b756ecee32342082aaed34b03aab58ed3d6e75a72b20c7a612
title: Hide Custom Objects and Custom Permissions in Your Subscribers’ Orgs
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/fma/pd-fma-hide-custom-objects-permissions.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/pd-fma-hide-custom-objects-permissions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0d507de6ff4b07655f93ff8bd343c901955e1fb6267f520cd9cb1d3f3568e614
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Hide Custom Objects and Custom Permissions in Your Subscribers’ Orgs

Occasionally, you want to include custom permissions or custom objects in a package but not show them to your subscribers. For example, if you're piloting a feature for a few select orgs, and want to hide custom permissions and custom objects related to the pilot feature.

**note:** Check with your company’s legal team before releasing hidden functionality.

To hide custom objects when creating your package, set the value of their Visibility field to `Protected`. After you've set the visibility to Protected, you can later update it to Unprotected. To change the visibility of an object, use the [CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm) Metadata API and update the `visibility` field.

To hide custom permissions when creating your package, from Setup, enter `Custom Permissions` in the Quick Find box. Select **Custom Permissions** | **_Your Custom Permission_** | **Edit**. Enable **Protected Component**, and then click **Save**. After your package is installed, use the `System.FeatureManagement.changeProtection()` Apex method to hide and unhide custom objects and permissions.

**note:** After you’ve released unprotected objects to subscribers, you can’t change the visibility to `Protected`.

**To hide custom permissions in released packages:**

- `System.FeatureManagement.changeProtection('YourCustomPermissionName', 'CustomPermission', 'Protected');`

**To unhide custom permissions and custom objects in released packages:**

- `System.FeatureManagement.changeProtection('YourCustomPermissionName', 'CustomPermission', 'Unprotected');`
- `System.FeatureManagement.changeProtection('YourCustomObjectName__c', 'CustomObject', 'Unprotected');`

**See Also**

- [Protected Components in Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg1_dev/packaging_protected_components.htm)
- [_Metadata API Developer Guide_: customObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm)
- [_Apex Reference Guide_: Feature Management Methods, changeProtection](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FeatureManagement.htm#apex_System_FeatureManagement_changeProtection)
