Search in sources :

Example 1 with Contract

use of org.openkilda.integration.source.store.dto.Contract in project open-kilda by telstra.

the class ContractService method getContracts.

/**
 * get contracts.
 *
 * @param linkId
 *            the link id
 * @throws AccessDeniedException the access denied exception
 */
public List<Contract> getContracts(String linkId) throws AccessDeniedException {
    LOGGER.info("Inside ContractService method getContracts");
    UserInfo userInfo = userService.getLoggedInUserInfo();
    if (userInfo.getPermissions().contains(IConstants.Permission.FW_FLOW_INVENTORY)) {
        if (userInfo.getPermissions().contains(IConstants.Permission.FW_FLOW_CONTRACT)) {
            List<Contract> contracts = flowStoreService.getContracts(linkId);
            return contracts;
        }
    }
    return null;
}
Also used : UserInfo(org.usermanagement.model.UserInfo) Contract(org.openkilda.integration.source.store.dto.Contract)

Aggregations

Contract (org.openkilda.integration.source.store.dto.Contract)1 UserInfo (org.usermanagement.model.UserInfo)1