Commit 428307cd by Tuomas Riihimäki

Check that user has permission to create verkkomaksu

1 parent 3dad43a9
......@@ -97,6 +97,10 @@ public class VerkkomaksutFiBean implements VerkkomaksutFiBeanLocal {
@Override
public boolean isSvmEnabled()
{
if (!permbean.hasPermission(BillPermission.CREATE_VERKKOMAKSU))
{
return false;
}
LanEventPrivateProperty expire = eventbean.getPrivateProperty(LanEventPrivatePropertyKey.VERKKOMAKSU_KEY_EXPIRE);
String merchantid = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.VERKKOMAKSU_MERCHANT_ID);
String merchantPassword = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.VERKKOMAKSU_MERCHANT_PASSWORD);
......
......@@ -99,7 +99,7 @@ public class BillEditView extends GenericCDIView {
public VerkkomaksutReturnEntry getVerkkomaksuFiToken()
{
if (bill != null && vmreturn == null)
if (isVerkkomaksuFiAvailable() && bill != null && vmreturn == null)
{
vmreturn = vmbean.getSvmToken(bill);
logger.info("Vmtoken url {}, token {}", vmreturn.getUrl(), vmreturn.getToken());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!