Hiding some Sharepoint elements from ribbon only for Read Only (non admins) with custom css
I am trying to make some page corrections only for some groups of site ins Sharepoint. I can check admin user in master page with SPSecurityTrimmedControl, but how can I insert custom css into master page only for let's say Read Only users? If I am trying like this:
This requirement might best be handled using audience targeting.
You can put the CSS into a Script Editor (or even an old Content Editor) web part and add it to the page. Then click the "Edit Web Part" option in the corner of the web part to make the web part properties panel appear. At the bottom of that panel, in the "Advanced" section, there's a field where you can enter "Target Audiences."
In the Target Audiences field, enter the names of any groups for whom you want the CSS to appear.
That web part will only be visible to members of the specified groups, regardless of their permissions on the site.
Note: The only real downside to this approach is that it only applies to specific pages where you add the web part and apply the audience targeting; it won't apply to all pages as if added to the masterpage of the site.
Asked in February 2016Viewed 3,729 timesVoted 10Answered 1 times