def _get_parameter_from_permission(self, session, permission, parameter_name, default_value = DEFAULT_VALUE):
        try:
            param = [ p for p in permission.parameters if p.get_name() == parameter_name ][0]
        except __HOLE__:
            if default_value == DEFAULT_VALUE:
                raise DbErrors.DbIllegalStatusError(
                    permission.get_permission_type() + " permission without " + parameter_name
                )
            else:
                return default_value
        return param.value
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/core/db.py/DatabaseGateway._get_parameter_from_permission