Hybris 用户注册的时候何如添加指定的用户组
主要逻辑:xxx.service.impl.ConsultantServiceImpl
public class ConsultantServiceImpl extends DefaultCustomerAccountService implements ConsultantService, CustomerAccountService
{
@Resource
private ConsultantDao consultantDao; @Resource
private ModelService modelService; public SearchPageData<CustomerModel> findAllCustomersByGroups(final List<String> groupKeys, final PageableData pageableData){
return consultantDao.findAllCustomersByGroups(groupKeys,pageableData);
} public UserModel getCurrentUser(){
return getUserService().getCurrentUser();
} public UserGroupModel getGroupForUid(String uid){
return getUserService().getUserGroupForUID(uid);
} public void saveCustomer(CustomerModel customerModel){
modelService.save(customerModel);
} public void initGroupForConsulatnt(CustomerModel customerModel){ if (customerModel.getCustomerRole()!=null&&customerModel.getCustomerRole().getCode().equals("customer")){
UserGroupModel userGroupModel = getGroupForUid(Config.getString(VehiclecommerceservicesConstants.CUSTOMER_GROUP_FOR_BUYER,"buyergroup"));
Set<PrincipalGroupModel> userGroups = new HashSet<>(customerModel.getGroups());
userGroups.add(userGroupModel);
customerModel.setGroups(userGroups);
}else{
UserGroupModel userGroupModel = getGroupForUid(Config.getString(VehiclecommerceservicesConstants.CUSTOMER_GROUP_FOR_CONSULATNT,"salesconsultant"));
Set<PrincipalGroupModel> userGroups = new HashSet<>(customerModel.getGroups());
userGroups.add(userGroupModel);
customerModel.setGroups(userGroups);
} }
}
Hybris 用户注册的时候何如添加指定的用户组的更多相关文章
- Oracle 当前日期如何添加指定年数、月数、天数、时数、分钟数、秒数
Oracle 当前时间如何添加指定数,来获取指定的年数.月份或其他的时间日期 --当前时间(2018-10-19 16:51:22)--- select sysdate nowDate from du ...
- linux系统添加指定uid和gid的用户和组
1.添加指定gid的组 groupadd -g 1001 upload # 添加了一个指定gid为1001的upload用户 2.添加指定uid的用户,并加入到指定组 useradd -u 1001 ...
- excel 如何为列添加指定内容(字符串)
excel 如何为列添加指定内容(字符串) CreateTime--2018年5月26日17:52:32 Author:Marydon 1.情景展示 D列的值需要获取B列的值并且在后面统一加上12 ...
- Eclipse中导入JDK类库的源代码以及添加指定的API
一.在Eclipse中导入JDK类库的源代码 操作步骤: 打开eclipse->“window”-> “Preferences” -> “Java” -> “Installed ...
- python练习六十二:文件处理,往文件中所有添加指定的前缀
往文件中所有添加指定的前缀 方法一:open方法 f_r = open('text.txt') f_w = open('text_new.txt','w+') i = 0 while True: i ...
- Confluence 6 自动添加用户到用户组
默认组成员(Default Group Memberships) 选项在 Confluence 3.5 及后续版本和 JIRA 4.3.3 及后续版本中可用.这字段将会在你选择 'Read Only, ...
- Linux下添加用户及用户组
创建用户组hdpgroup: $ sudo addgroup hdpgroup 如果用户hdp不存在,把hdp添加到hdpgroup用户组: $ sudo adduser --force -ingro ...
- git只添加指定类型的文件的.gitignore规则
#忽略根目录下的所有文件 * #忽略子目录下的所有文件 /* #包含目录 !*/ #指定不忽略的文件 !*.c !*.h #忽略根目录下的文件 /build/ /appveyor/ /pear/ /s ...
- matlab 工具函数(一) —— 添加指定 SNR 的噪声
SNR=PsignalPnoise=10⋅log10∑x=1Nx∑y=1Nyf2(x,y)∑x=1Nx∑y=1Ny(f(x,y)−f^(x,y))2=20⋅log10∥f(x,y)∥∥f^(x,y)− ...
随机推荐
- Golang标准库——io-接口
接口 Read相关 Reader Reader接口用于包装基本的读取方法. type Reader interface { //将数据读入到p中,直到读满p或者读取的过程中遇到错误,此时返回的n< ...
- 一个复杂Json的解析
{ "website": { "1": { "basic": { "homepage": "http://py ...
- 设计模式-----Builder模式
前言 近日,看到Myabtis中组件中SqlSessionFactory由SqlSessionFactoryBuilder().build()生成时,且采用Builder模式,遂记录学习之. SqlS ...
- S3C2440 DMA 驱动示例
将 DMA 抽象为一个字符设备,在初始化函数中调用 void *dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t * ...
- [转]VS Code 扩展 Angular 6 Snippets - TypeScript, Html, Angular Material, ngRx, RxJS & Flex Layout
本文转自:https://marketplace.visualstudio.com/items?itemName=Mikael.Angular-BeastCode VSCode Angular Typ ...
- C# 线程间互相通信 AutoResetEvent和ManualResetEvent
C#线程间互相通信主要用到两个类:AutoResetEvent和ManualResetEvent. 一.AutoResetEvent AutoResetEvent 允许线程通过发信号互相通信,线程通过 ...
- Java并发编程:ThreadLocal的使用以及实现原理解析
前言 前面的文章里,我们学习了有关锁的使用,锁的机制是保证同一时刻只能有一个线程访问临界区的资源,也就是通过控制资源的手段来保证线程安全,这固然是一种有效的手段,但程序的运行效率也因此大大降低.那么, ...
- 设计模式之观察者模式(Observer)
观察者模式通常的叫法叫做订阅-发布模式,类似于报刊杂志的订阅,观察者和被观察者就是读者和邮局的关系,读者先要在邮局订阅想要的报刊,当报刊发行时,邮局会将报刊邮寄到读者家里.观察者(Observer)和 ...
- js 如何移除一个匿名函数的绑定事件
大家都知道 addEventListener的用法 绑定事件 例如 element.addEventListener(type,handler,false); element是dom元素 type是事 ...
- element-ui 组件源码分析整理笔记目录
element-ui button组件 radio组件源码分析整理笔记(一) element-ui switch组件源码分析整理笔记(二) element-ui inputNumber.Card .B ...