def apply_user_permissions(doctype, ptype, user=None):
 role_permissions = get_role_permissions(frappe.get_meta(doctype), user=user)
 return role_permissions.get(u'apply_user_permissions', {}).get(ptype)

def apply_user_permissions ( doctype , ptype , user = None ) : role_permissions = get_role_permissions ( frappe . get_meta ( doctype ) , user = user ) return role_permissions . get ( u'apply_user_permissions' , { } ) . get ( ptype )
check if apply_user_permissions is checked for a doctype .