Current Process:

I am having a CSS & JS file in Site Assets, which I render it to some List / Library using Content Editor ( referencing the CSS/JS).


What I need is, End User shouldn't access these files or see the codes inside my CSS & JS. Is there any possibility that I will add the CSS/JS inside a Master Page or somewhere else (globally) and get the List and Library name (to be applied with changes) from a master list !! So that a non-coder admin can only add list/lib name into that master list and the required changes will apply on that list/library automatically

  • 1
    just curious to know, "What I need is, End User shouldn't access these files or see the codes inside my CSS & JS" user should have at least read permission to those files then only css or JS will be applied or loaded to the page. There is nothing wrong if user sees your Javascript code since he/she cant modfiy. if you want your script to be non readable format. you can try to minimize the script and store in site Assets. Commented Dec 7, 2018 at 9:28
  • Thanks for the comments @vinitkumar, how can I minimize a script or stylesheet, please suggest. Commented Dec 7, 2018 at 9:56
  • 1
    You can easily find many tools or onsite website available which does minification of javascript. Some tools even bundle your js so user can't easily understand code. Developer like us still can understand😊. Here a website javascript-minifier.com Commented Dec 7, 2018 at 15:16

1 Answer 1


You can:
1. Break CSS / JS files role inheritance in your document library and give it more advanced permissions for End User. And he can see this files.
2. Embed your css and js into page. Content Editor or Script Editor allow this.
3. Create your own document library only with that files and give End User access to this new document library.

Master page here is must be last way.

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.