1

I have a scenario where I need to hide the edit layout button on particular for any user by the apex. We can use visualforce page once it loaded to check the condition we hide the 'edit layout' but I couldn't get anything around that how it can be done?

3
  • Only users with Customize Application will see this option. Are you trying to hide this function from System Administrators?
    – sfdcfox
    Commented May 5, 2020 at 11:57
  • I wanted to manage that permission by apex Commented May 5, 2020 at 15:56
  • 1
    No, that's managed by system permissions.
    – sfdcfox
    Commented May 5, 2020 at 16:02

1 Answer 1

2

As sfdxfox commented, the availability of the edit layout button is currently controlled by the "Customize Application" System Permission.

Something you could try is taking the permission away from the profiles of all the users who might need it hidden. Then use a PermissionSetAssignment and a permission set with "Customize Application" enabled to selectively grant it again.

enter image description here

5
  • I don't think you need a Custom Permission here.
    – Adrian Larson
    Commented May 6, 2020 at 3:44
  • @AdrianLarson You don't think the custom Permission Set to selectively grant the "Customize Application" system permission to the user is required? Commented May 6, 2020 at 20:07
  • I guess all permissions sets are "custom". Is it just a problem with the wording? I'm not aware of another way to selectively regrant the required permission to a subset of users. Well, short of changing their profile or assigning them to a group. Commented May 6, 2020 at 20:09
  • There are two separate but similarly named features in Custom Permissions and Permission Sets. To use the phrase "custom permission sets" is therefore confusing.
    – Adrian Larson
    Commented May 6, 2020 at 20:58
  • @AdrianLarson OK. I've tried to clarify that the permission set is required for use with the permission set assignment. Commented May 6, 2020 at 22:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .