Package com.sishuok.es.sys.auth.entity

Examples of com.sishuok.es.sys.auth.entity.Auth


            User user = userService.findOne(userId);
            if (user == null) {
                continue;
            }

            Auth auth = getAuthRepository().findByUserId(userId);
            if (auth != null) {
                auth.addRoleIds(m.getRoleIds());
                continue;
            }
            auth = new Auth();
            auth.setUserId(userId);
            auth.setType(m.getType());
            auth.setRoleIds(m.getRoleIds());
            save(auth);
        }
    }
View Full Code Here


            Group group = groupService.findOne(groupId);
            if (group == null) {
                continue;
            }

            Auth auth = getAuthRepository().findByGroupId(groupId);
            if (auth != null) {
                auth.addRoleIds(m.getRoleIds());
                continue;
            }
            auth = new Auth();
            auth.setGroupId(groupId);
            auth.setType(m.getType());
            auth.setRoleIds(m.getRoleIds());
            save(auth);
        }
    }
View Full Code Here

        if (jobId == null) {
            jobId = 0L;
        }


        Auth auth = getAuthRepository().findByOrganizationIdAndJobId(organizationId, jobId);
        if (auth != null) {
            auth.addRoleIds(m.getRoleIds());
            return;
        }

        auth = new Auth();
        auth.setOrganizationId(organizationId);
        auth.setJobId(jobId);
        auth.setType(m.getType());
        auth.setRoleIds(m.getRoleIds());
        save(auth);


    }
View Full Code Here

        throw new RuntimeException("discard method");
    }

    @RequestMapping(value = "{type}/create", method = RequestMethod.GET)
    public String showCreateFormWithType(@PathVariable("type") AuthType type, Model model) {
        Auth auth = new Auth();
        auth.setType(type);
        model.addAttribute("m", auth);
        return super.showCreateForm(model);
    }
View Full Code Here

    @Before(value = "authServicePointcut() && authCacheEvictAllOrSpecialPointcut(arg)", argNames = "jp,arg")
    public void authCacheClearSpecialOrAllAdvice(JoinPoint jp, Object arg) {
        log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice begin", cacheName);
        String methodName = jp.getSignature().getName();
        if (arg instanceof Auth) {//只清除某个用户的即可
            Auth auth = (Auth) arg;

            log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice delegate to evictWithAuth", cacheName);
            evictWithAuth(auth);
        } else if ("delete".equals(methodName)) { //删除方法
            if (arg instanceof Long) { //删除单个
                Long authId = (Long) arg;
                Auth auth = authService.findOne(authId);

                log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice delegate to evictWithAuth", cacheName);
                evictWithAuth(auth);
            } else if (arg instanceof Long[]) { //批量删除
                for (Long authId : ((Long[]) arg)) {
                    Auth auth = authService.findOne(authId);

                    log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice delegate to evictWithAuth", cacheName);
                    if (evictWithAuth(auth)) {//如果清空的是所有 直接返回
                        return;
                    }
View Full Code Here

TOP

Related Classes of com.sishuok.es.sys.auth.entity.Auth

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.