
org.xlcloud.console.entitlements.ResourceEntitlementsEngine Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2012 AMG.lab, a Bull Group Company
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.xlcloud.console.entitlements;
import java.util.List;
import org.xlcloud.console.context.EntitlementEngine;
import org.xlcloud.service.CatalogScopeType;
/**
* Interface for classes that wraps {@link EntitlementEngine} with methods that returns user entitlements for specific resources.
* @author Konrad Król, AMG.net
*/
public interface ResourceEntitlementsEngine {
/**
* @return {@code true} if current user is able to register private resources of the @param type,
* {@code false} otherwise.
*/
boolean canRegisterPrivate();
/**
* @return {@code true} if current user is able to register public resources of the @param type,
* {@code false} otherwise.
*/
boolean canRegisterPublic();
/**
* @return {@code true} if current user is able to list public resources of the @param type,
* {@code false} otherwise.
*/
boolean canListPublic();
/**
* @return {@code true} if current user is able to list private resources of the @param type,
* {@code false} otherwise.
*/
boolean canListPrivate();
/**
* @param resource
* - resource to be verified
* @return {@code true} if current user is able to edit given resource, {@code false} otherwise
*/
public boolean canEdit(T resource);
/**
* @param resource
* - resource to be verified
* @return {@code true} if current user is able to delete given resource, {@code false} otherwise
*/
public boolean canDelete(T resource);
/**
* @return the list of catalog scopes, that user is able to set for new resources of the @param type
*/
List getAvailableScopes();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy