blob: b6668618e6a6488f3116be5300b9874f9351e92b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 Tasktop Technologies and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.discovery.core.model;
/**
* a policy defines what is permitted.
*
* @author David Green
*/
public class Policy {
/**
* Define system property <code>org.eclipse.mylyn.internal.discovery.core.model.Policy.permissive=true</code> to
* allow for categories to be permitted by anyone. For testing purposes.
*/
private static final boolean PERMISSIVE = Boolean.getBoolean(Policy.class.getName() + ".permissive"); //$NON-NLS-1$
private static final Policy DEFAULT = new Policy(false);
private final boolean permitCategories;
public Policy(boolean permitCategories) {
this.permitCategories = permitCategories;
}
public boolean isPermitCategories() {
return permitCategories || PERMISSIVE;
}
public static Policy defaultPolicy() {
return DEFAULT;
}
}