Using JSOM we can check if a user has specific permission granted in the site. The kind of permission we can check if assigned can be specified by SP.PermissionKind.* properties as follows.

JSOM code
Please refer to this blog post to achieve the same capability using SharePoint 2013 REST API
Cheers !