troubleshooting Question

JavaScript function to check CSV against some JSON

Avatar of interclubs
interclubs asked on
JavaScript
4 Comments1 Solution212 ViewsLast Modified:
So I am looking for a function that I can use like this:

checkPermission('email,status_update,publish_stream,offline_access');

function checkPermission(csvList) {
    jsonList = '...';
}

So inside the function it would loop through some JSON (below) and compare each item in csvList to make sure it appears in the JSON. If each item in the csvList appears in the JSON it returns true, if not false...

JSON:
{"extended":["status_update","photo_upload","video_upload","offline_access","email","create_note","share_item","publish_stream","contact_email","manage_pages"],"user":["read_stream","publish_stream","access_private_data"],"friends":["read_stream","access_private_data"]}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros