code: def validate_permission(self, key, permission):
          
          if permission.perm_name not in self.__possible_permissions__:
              raise AssertionError(
                  "perm_name is not one of {}".format(self.__possible_permissions__)
              )
          return permission
docs: validates if group can get assigned with permission