<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_permission(self, permission, obj=None):
 """Returns if the current user has rights for the permission passed in :param permission: permission identifier :param obj: object to check the permission against :return: True if the user has rights for the permission passed in """

        if not permission:
            logger.warn("None permission is not allowed")
            return False
        if obj is None:
            return check_permission(permission, self.context)
        return check_permission(permission, api.get_object(obj))