Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Updating Measure Data #58

Open
jacorralesz opened this issue Apr 9, 2018 · 4 comments
Open

Error Updating Measure Data #58

jacorralesz opened this issue Apr 9, 2018 · 4 comments

Comments

@jacorralesz
Copy link

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
Copy link
Owner

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
Copy link
Author

jacorralesz commented Apr 10, 2018 via email

@billchen198318
Copy link
Owner

billchen198318 commented Apr 10, 2018

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.

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
Copy link
Owner

billchen198318 commented Apr 12, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants