def has_perm(self, user, perm, obj=None, *args, **kwargs):
try:<EOL><INDENT>if not self._obj_ok(obj):<EOL><INDENT>if hasattr(obj, '<STR_LIT>'):<EOL><INDENT>obj = obj.get_permissions_object(perm)<EOL><DEDENT>else:<EOL><INDENT>raise InvalidPermissionObjectException<EOL><DEDENT><DEDENT>return user.permset_tree.allow(Action(perm), obj)<EOL><DEDENT>except ObjectDoesNotExist:<EOL><INDENT>return False<EOL><DEDENT>
Test user permissions for a single action and object.

        :param user: The user to test.
        :type user: ``User``
        :param perm: The action to test.
        :type perm: ``str``
        :param obj: The object path to test.
        :type obj: ``tutelary.engine.Object``
        :returns: ``bool`` -- is the action permitted?