billchen198318 / bamboobsc

next version move to https://github.com/billchen198318/hillfog, bambooBSC is an opensource Balanced Scorecard (BSC) Business Intelligence (BI) Web platform. BSC's Vision, Perspectives, Objectives of strategy, Key Performance Indicators (KPIs), Strategy Map, and SWOT, PDCA & PDCA report, Time Series Analysis.
Apache License 2.0
227 stars 110 forks source link

Error Updating Measure Data #58

Open jacorralesz opened 6 years ago

jacorralesz commented 6 years ago

Hello. I have been testing Bamboobsc and it looks great, I think is what I need. What I haven't understood clearly is how to keep updated the measure data. I have created a couple users and I have assigned different kpis to each of them. When I enter to bamboo with one of them I am able to see not only the KPI´s assigned to that user but also I can see the KPI´s from other users and even I can modify their information. I think this is wrong right?

billchen198318 commented 6 years ago

Please look bamboobsc-guide.pdf page 12 (5. Measure-data).

If you still can't input updates, please cut operation screen , put in the issues.

jacorralesz commented 6 years ago

Hi Bill,

Thanks for your answer.

I think that I couldn't explain clearly en my original post. The updating measure process is working like a charm, what I mean is that all the KPI's are like public for all users.

For example, If I assign a KPI to the user "A", when user "B" enter to the system, the "B" user can access and modify the KPI's for "A" user...

I don't know if that's is how the BambooBSC works or if I am doing something wrong during the setting up. What I would like to configure is the KPI's as private, belonging just to one user as all the KPI's are differents

Once again, thanks for your time and your answer.

2018-04-09 18:37 GMT-06:00 Bill chen notifications@github.com:

Please look bamboobsc-guide.pdf page 12 (5. Measure-data).

If you still can't input updates, please cut operation screen , put in the issues.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/billchen198318/bamboobsc/issues/58#issuecomment-379936801, or mute the thread https://github.com/notifications/unsubscribe-auth/AkdHozP2I_VZguqSm1u_PJSIEAQTYdneks5tm_7VgaJpZM4TNCGO .

billchen198318 commented 6 years ago

1. Default has BSC_STANDARD role user can do the measure-data . You can use role control some user cannot use measure-data. create an now role for the no-operation measure-data user.

  1. If you want all user role is BSC_STANDARD , only a way. write expression do it. You need can use bambooBSC expression and bambooBSC bean support settings do it. but i now no free time write expreesion help you at now. i will do it, give you an bambooBSC-expression and how to settings step. You may have to give me a few days, and I will do it when has free time.

billchen198318 commented 6 years ago

STEP-01 Management expression. 001



STEP-02 edit expression content Please paste the GROOVY expression content in edit block

import java.util.*;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.netsteadfast.greenstep.po.hbm.*;
import com.netsteadfast.greenstep.vo.*;
import com.netsteadfast.greenstep.bsc.service.*;
import com.netsteadfast.greenstep.base.service.logic.*;
import com.netsteadfast.greenstep.base.exception.*;
import com.netsteadfast.greenstep.base.*;
import com.netsteadfast.greenstep.base.model.*;

Subject subject = SecurityUtils.getSubject();
String accountId = (String)subject.getPrincipal();

IKpiService<KpiVO, BbKpi, String> kpiService = (IKpiService<KpiVO, BbKpi, String>) AppContext.getBean("bsc.service.KpiService");
IKpiEmplService<KpiEmplVO, BbKpiEmpl, String> kpiEmplService = (IKpiEmplService<KpiEmplVO, BbKpiEmpl, String>) AppContext.getBean("bsc.service.KpiEmplService");
IEmployeeService<EmployeeVO, BbEmployee, String> employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
BbKpi kpi = kpiService.findByPKng( kpiOid );

if ( !YesNo.YES.equals( kpi.userMeasureSeparate ) ) {
    return;
}

EmployeeVO employee = BscBaseLogicServiceCommonSupport.findEmployeeDataByAccountId(employeeService, accountId);

Map<String, Object> params = new HashMap<String, Object>();
params.put("kpiId", kpi.getId());
List<BbKpiEmpl> searchList = kpiEmplService.findListByParams(params);

boolean isAllowModify = false;
for (BbKpiEmpl kpiEmpl : searchList) {
    if ( employee.getEmpId().equals( kpiEmpl.getEmpId() ) ) {
        isAllowModify = true;
    }
}

if (!isAllowModify) {
  throw new ServiceException("The measure data you cannot modify, " + SysMessageUtil.get(GreenStepSysMsgConstants.NO_PERMISSION));
}

002



STEP-03 Management Script support settings 003



STEP-04 enable config. 004



Test result 005