You may be able to use JS CSOM and still apply permissions to your folders/items using this class:
http://msdn.microsoft.com/en-us/library/ee659610(v=office.14).aspx
I haven't tried it but it looks promising.
Cheers,
Matthew
http://msdn.microsoft.com/en-us/library/ee659610(v=office.14).aspx
I haven't tried it but it looks promising.
Cheers,
Matthew