#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from Model.models import UserModel


class ModelService:

    @staticmethod
    def check_perm(userID, permID):
        try:
            user_qs = UserModel.objects.filter(id=userID)
            if user_qs.exists():
                user = user_qs[0]
                if int(user.permission) != 0:
                    return False
                else:
                    return True
            else:
                return False
        except Exception as e:
            print(repr(e))
