This is a very open question… you're much more likely to get a better answer if you provide more details. In general you will be able to get the folder level permission via the REST API called from the WebScripts controller. Depending upon the what part of the application you're working with (e.g. what page, what WebScript, etc) you may find you already have the details in the WebScript model.