from apps.system.permission import RbacPermission, has_permission


class RecordPermission(RbacPermission):
    def has_object_permission(self, request, view, obj):
        if has_permission('record_confirm', request.user):
            return True
        elif request.user.dept == obj.belong_dept:
            return False
        return True