use of org.wso2.carbon.apimgt.impl.dto.TierPermissionDTO in project carbon-apimgt by wso2.
the class ThrottlingApiServiceImpl method setPolicyPermissionsToDTO.
/**
* Set subscription throttle policy permission info into the DTO
*
* @param policyDTO subscription throttle policy DTO
* @throws APIManagementException error while setting/retrieve the permissions to the DTO
*/
private void setPolicyPermissionsToDTO(SubscriptionThrottlePolicyDTO policyDTO) throws APIManagementException {
APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider();
TierPermissionDTO addedPolicyPermission = (TierPermissionDTO) apiProvider.getThrottleTierPermission(policyDTO.getPolicyName());
if (addedPolicyPermission != null) {
SubscriptionThrottlePolicyPermissionDTO addedPolicyPermissionDTO = SubscriptionThrottlePolicyMappingUtil.fromSubscriptionThrottlePolicyPermissionToDTO(addedPolicyPermission);
policyDTO.setPermissions(addedPolicyPermissionDTO);
}
}
Aggregations