i have been sharing folders to external clients. Each time when i add a user to a folder (edit\Read permission) a limited access permission gets added automatically. and has been creating problems so i removed the style readers group. But the problem is now no one can access the site as used to how do i get back or restore the access to the previous state.
Limited Access is a special system permission added by SharePoint automatically.
There are many parts in SharePoint which are security trimmed. Now imagine a situation, when you want to share some folder with special group, but this group doesn't have any permissions on the site yet. So you are adding permissions directly to the folder. In that case your group still doesn't have a permission to parent security object, web. If a user from this group tries to open this shared folder, he will get access denied, which is not correct, since you want him to see this folder.
To avoid such a strange situation, SharePoint also added
Limited Access permission to this group (only in case if the group doesn't have permission on a root web for example). By deleting
Style Resource Readers group you effectively removed permissions from the web and now have situation described above, when your users are getting access denied.
You can either explicitly give Read permissions to your users on a web, or you can "Restore"
Style Resource Readers group. For restore, you need to create this group first (don't give any permissions when creating, this is important). Then create some temporary list, break permissions inheritance for this list, under permissions for the list add
Style Resource Readers group. Now go to Site Settings -> Permissions -> Check permissions, enter
Style Resource Readers and make sure that now
Style Resource Readers has Limited Access given directly. Add required users to
Style Resource Readers (
NT AUTHORITY\authenticated users or
Everyone or any others depending on your needs)
If you modified the permissions in a subsite, you can always choose to inherit permissions again from the parent.
If you're working on the root web inside your site collection, then you won't be able to get back the modified permissions. You can however give all users read only permission to the site by adding them to the visitors group, then start applying extra permissions anywhere else.