use of com.netsteadfast.greenstep.base.model.BaseSimpleActionInfo in project bamboobsc by billchen198318.
the class BaseSupportAction method isActionAuthorize.
/**
* ControllerAuthorityCheckInterceptor 會去掉沒有權限的action, 只是配合 json 通一變數 "isAuthorize" 要用到
*
* @return
*/
protected String isActionAuthorize() {
((BaseSimpleActionInfo) this.baseActionInfoProvide).handlerActionAnnotations();
Subject subject = SecurityUtils.getSubject();
if (subject.hasRole(Constants.SUPER_ROLE_ALL) || subject.hasRole(Constants.SUPER_ROLE_ADMIN)) {
return YesNo.YES;
}
if (this.isControllerAuthority(((BaseSimpleActionInfo) this.baseActionInfoProvide).getActionAnnotations(), ((BaseSimpleActionInfo) this.baseActionInfoProvide).getActionMethodAnnotations(), subject)) {
return YesNo.YES;
}
if (subject.isPermitted(this.baseActionInfoProvide.getPageInfoActionName() + Constants._S2_ACTION_EXTENSION)) {
return YesNo.YES;
}
return YesNo.NO;
}
use of com.netsteadfast.greenstep.base.model.BaseSimpleActionInfo in project bamboobsc by billchen198318.
the class BaseSupportAction method getActionMethodProgramId.
// ----------------------------------------------------------------------------
public String getActionMethodProgramId() {
((BaseSimpleActionInfo) this.baseActionInfoProvide).handlerActionAnnotations();
Annotation[] annotations = ((BaseSimpleActionInfo) this.baseActionInfoProvide).getActionMethodAnnotations();
if (annotations == null || annotations.length < 1) {
return "";
}
String progId = "";
for (Annotation annotation : annotations) {
if (annotation instanceof ControllerMethodAuthority) {
progId = this.defaultString(((ControllerMethodAuthority) annotation).programId());
}
}
if (StringUtils.isBlank(progId)) {
// 沒有ControllerMethodAuthority , 就找 url 的 prog_id 參數 , 主要是 COMMON FORM 會用到
progId = this.defaultString(ActionContext.getContext().getValueStack().findString("prog_id"));
}
return progId;
}
Aggregations