Test if a given type has a permission
#include <secpol/secpol.h>
int secpol_check_permission(const struct _msg_info *info, uint32_t otype, const secpol_permission_t *permission)
In most cases, all errors should be treated identically.
The otype argument allows you to restrict the test for a permission to a specific object that the permission accesses or acts on. For more information, see Customizing permissions using a security policy.
0 if the type ptype has the indicated permission for the type otype, or -1 if the call failed (errno is set).