I am currently using the method stated in the MSDN Walkthrough to remove the "Library" tab from the Library Tools contextual tab group and it is working for the site for all users.

However, I would like such solution conditionally to be applicable only to non-administrators. I have tried adding "Rights" element in the xml but it is not working as intended.

How do I go about doing this?

1 Answer 1


You can use other OM methods to determine the user's permission and call the TrimById method accordingly. For example, you could use DoesUserHavePermissions on the page's list item:


Please look into following link

Hiding buttons of the Ribbon Bar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.