This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parse.Cloud.define('isAdmin', function(request, response){ | |
if(!Parse.User.current()){ | |
response.error('Request did not have an authenticated user attached with it'); | |
} | |
else { | |
userHasRole(request.params.parseSessionToken, 'super') // ex: check if user has "super" role | |
.then(function(hasRole){ | |
if(hasRole){ | |
response.success({super: true}); | |
}else{ |