| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import com.vci.common.log.LogType; |
| | | import com.vci.common.log.ServerWithLog4j; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.framework.data.RoleRightInfo; |
| | | import com.vci.corba.log.data.LogType; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.framework.data.UserInfo; |
| | | import com.vci.corba.framework.data.RoleInfo; |
| | | import com.vci.server.base.delegate.BaseDelegate; |
| | | import com.vci.server.base.utility.LogRecordUtil; |
| | | import com.vci.server.cache.OrgCacheProvider; |
| | | import com.vci.server.framework.funcmng.function.Function; |
| | | import com.vci.server.framework.funcmng.function.FunctionService; |
| | | import com.vci.server.framework.right.roleRight.RoleRight; |
| | | import com.vci.server.framework.right.roleRight.RoleRightService; |
| | | import com.vci.server.framework.systemConfig.log.LogRecordUtil; |
| | | import com.vci.server.framework.systemConfig.stafforgmanage.role.Role; |
| | | import com.vci.server.framework.systemConfig.stafforgmanage.role.RoleService; |
| | | |
| | |
| | | //roleRights[i].setRightType(rightType); |
| | | } |
| | | |
| | | Role role = roleService.selectRole(roleId); |
| | | RoleInfo role = OrgCacheProvider.getRole(roleId); |
| | | //Role role = OrgCacheProvider.getRole(roleId); |
| | | if (roleRights.length > 0) { |
| | | res = service.saveRoleRight(roleRights, roleId, rightType); |
| | | try { |
| | |
| | | } |
| | | } |
| | | sb.append("等共计" + roleRightInfos.length + "个权限"); |
| | | logInfo = "操作的角色信息为:" + role.getLogInfo() + ",权限包括:" + sb.toString(); |
| | | logInfo = "操作的角色信息为:角色[" + role.name + "],权限包括:" + sb.toString(); |
| | | } else { |
| | | logInfo = "操作的角色信息为:" + role.getLogInfo(); |
| | | logInfo = "操作的角色信息为:角色[" + role.name + "]"; |
| | | } |
| | | |
| | | if (res) |
| | | LogRecordUtil.writeLog(userEntity, "授权", "成功", logInfo, LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "授权", "成功", logInfo, LogType.Grant, role.id); |
| | | else |
| | | LogRecordUtil.writeLog(userEntity, "授权", "失败", logInfo, LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "授权", "失败", logInfo, LogType.Grant, role.id); |
| | | |
| | | } catch (Exception e) { |
| | | //e.printStackTrace(); |
| | |
| | | } catch (Exception e) { |
| | | //e.printStackTrace(); |
| | | ServerWithLog4j.logger.error(e); |
| | | LogRecordUtil.writeLog(userEntity, "授权", "功能模块授权失败!", e.getMessage(), LogType.GrantPrivileges, roleId); |
| | | LogRecordUtil.writeLog(userEntityInfo, "授权", "功能模块授权失败!", e.getMessage(), LogType.Grant, roleId); |
| | | throw new VCIError("0", new String[] { e.getMessage() }); |
| | | } |
| | | return res; |
| | |
| | | res = service.removeRoleRight(roleRights, roleId); |
| | | |
| | | if (res) |
| | | LogRecordUtil.writeLog(userEntity, "授权", "成功", role.getLogInfo(), LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "授权", "成功", role.getLogInfo(), LogType.Grant, role.getId()); |
| | | else |
| | | LogRecordUtil.writeLog(userEntity, "授权", "失败", role.getLogInfo(), LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "授权", "失败", role.getLogInfo(), LogType.Grant, role.getId()); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | //e.printStackTrace(); |
| | | ServerWithLog4j.logger.error(e); |
| | | // LogRecordUtil.writeLog(userEntity, "授权", |
| | | // "功能模块授权失败!",LogType.GrantPrivileges); |
| | | // "功能模块授权失败!",LogType.Grant); |
| | | throw new VCIError("0", new String[0]); |
| | | } |
| | | return res; |
| | |
| | | |
| | | Role role = roleService.selectRole(roleId); |
| | | res = service.reAddRoleRight(roleRights, roleId, rightType); |
| | | LogRecordUtil.writeLog(userEntity, "增加授权", "成功", role.getLogInfo(), LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "增加授权", "成功", role.getLogInfo(), LogType.Grant, role.getId()); |
| | | } catch (Exception e) { |
| | | //e.printStackTrace(); |
| | | ServerWithLog4j.logger.error(e); |
| | | // LogRecordUtil.writeLog(userEntity, "授权", |
| | | // "功能模块授权失败!",LogType.GrantPrivileges); |
| | | // "功能模块授权失败!",LogType.Grant); |
| | | throw new VCIError("0", new String[0]); |
| | | } |
| | | return res; |
| | |
| | | Role role = roleService.selectRole(roleId); |
| | | res = service.reAddRoleRightWithNoCheck(roleRights, rightType); |
| | | if (res) |
| | | LogRecordUtil.writeLog(userEntity, "增加授权", "成功", role.getLogInfo(), LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "增加授权", "成功", role.getLogInfo(), LogType.Grant, role.getId()); |
| | | else |
| | | LogRecordUtil.writeLog(userEntity, "增加授权", "失败", role.getLogInfo(), LogType.GrantPrivileges, role.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "增加授权", "失败", role.getLogInfo(), LogType.Grant, role.getId()); |
| | | } catch (Exception e) { |
| | | //e.printStackTrace(); |
| | | ServerWithLog4j.logger.error(e); |
| | | // LogRecordUtil.writeLog(userEntity, "授权", |
| | | // "功能模块授权失败!",LogType.GrantPrivileges); |
| | | // "功能模块授权失败!",LogType.Grant); |
| | | throw new VCIError("0", new String[0]); |
| | | } |
| | | return res; |