def _has_perm(self, user, permission):
        """ Check whether the user has the given permission

        @return True if user is granted with access, False if not.
        """

        if user.is_superuser:
            return True
        if user.is_active:
            perms = [perm.split('.')[1] for perm in user.get_all_permissions()]
            return permission in perms
        return False