validation
stringlengths
16
3.54k
validationType
stringclasses
2 values
function
stringlengths
49
6.38k
author
stringclasses
5 values
context
stringclasses
5 values
if (!hasBizPermission(request, project.getBizId())) { throw new RuntimeException("您没有相关业务线的权限,请联系管理员开通"); }
conventional
@RequestMapping("/updatePage") public String updatePage(HttpServletRequest request, Model model, int id) { // document XxlApiDocument xxlApiDocument = xxlApiDocumentDao.load(id); if (xxlApiDocument == null) { throw new RuntimeException("操作失败,接口ID非法"); } model.addAttribute("document", xxlApiD...
万爽
@PreAuthorize<method*start>org.springframework.security.access.prepost.PreAuthorize<method*end>("hasAnyRole('ADMIN','USER_ALL','USER_DELETE')")
annotation
@Log<method*start>com.dxj.log.annotation.Log<method*end>("删除用户") @DeleteMapping<method*start>org.springframework.web.bind.annotation.DeleteMapping<method*end>(value<method*start>org.springframework.web.bind.annotation.GetMapping.value<method*end> = "/user/{id}") public ResponseEntity<method*start>org.springframework.h...
万爽
// 当前登陆用户权限 Subject<method*start>org.apache.shiro.subject.Subject<method*end> subject = SecurityUtils.getSubject<method*start>org.apache.shiro.SecurityUtils.getSubject<method*end>(); String<method*start>java.lang.String<method*end> username = (String<method*start>java.lang.String<method*end>) subject.getPrincipal<metho...
conventional
@ApiOperation<method*start>io.swagger.annotations.ApiOperation<method*end>(value<method*start>io.swagger.annotations.Api.value<method*end> = "后台首页") @RequestMapping<method*start>org.springframework.web.bind.annotation.RequestMapping<method*end>(value<method*start>io.swagger.annotations.Api.value<method*end> = "/index",...
万爽
if (user == null) { return ServerResponse.createByErrorCodeMessage<method*start>com.mmall.common.ServerResponse.createByErrorCodeMessage<method*end>(ResponseCode.NEED_LOGIN.getCode<method*start>com.mmall.common.ResponseCode.getCode<method*end>(), "用户未登录,请登录管理员"); } if (iUserService.checkAdminRole<method...
conventional
@RequestMapping<method*start>org.springframework.web.bind.annotation.RequestMapping<method*end>("send_goods.do") @ResponseBody public ServerResponse<method*start>com.mmall.common.ServerResponse<method*end><String<method*start>java.lang.String<method*end>> orderSendGoods(HttpSession<method*start>javax.servlet.http.HttpS...
万爽
@AuthRuleAnnotation("admin/auth/role/auth")
annotation
@PostMapping("/admin/auth/role/auth") public BaseResponse<method*start>com.lmxdawn.api.common.res.BaseResponse<method*end> auth(@RequestBody @Valid AuthRoleAuthRequest authRoleAuthRequest, BindingResult<method*start>org.springframework.validation.BindingResult<method*end> bindingResult) { if (bindingResult.hasError...
万爽
// 当前是游客则无操作权限 if (currentUserId.equals(USER.VISITOR_ID)) { return false; } // 当前是admin if (currentUserId.equals(USER.ADMIN_ID)) { return true; } // 帖子作者是当前用户id if (writerId.equals(currentUserId)) { return true; } ...
conventional
public static boolean hasEditPrivilege(Long writerId, Long currentUserId) { try { // 当前是游客则无操作权限 return true; } catch (Exception e) { logger.error("login valid permission error", e); return false; } }
万爽
if (id == 1) { return data = DataVo.failure("超级管理员组不能删除"); }
conventional
@PostMapping("/group_del") @ResponseBody public DataVo deleteGroup(@RequestParam(value = "id") Long id) { DataVo data = DataVo.failure("操作失败"); if (groupService.deleteGroup(id)) { data = DataVo.success("该权限组已删除"); } else { data = DataVo.failure("删除失败或者不存在!"); } return data; }
万爽
@RequiresPermissions<method*start>org.apache.shiro.authz.annotation.RequiresPermissions<method*end>("oss:pdf:view")
annotation
@ApiOperation<method*start>io.swagger.annotations.ApiOperation<method*end>(value = "pdf预览", notes<method*start>io.swagger.annotations.ApiOperation.notes<method*end> = "权限编码(oss:pdf:view)") @GetMapping<method*start>org.springframework.web.bind.annotation.GetMapping<method*end>("/view") public void pdfViewer(HttpServletR...
肖敬先
if (command.getGmLevel() > gmLevel) { return "你没有权限执行此GM命令"; }
conventional
private String execGmCmd(Session session, String gmStr, int gmLevel) { gmStr = gmStr.substring(1); String[] commandArray = gmStr.split(" "); GMCommand command = GMCommand.getCommand(commandArray[0]); if (command == null) { return "没有对应GM命令"; } Gm gm = GMCommand.getGm(command); S...
肖敬先
@PreAuthorize("@permissionService.hasPermission('system:role:add')")
annotation
@PostMapping public AjaxResult add(@RequestBody Role role) { if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) { re...
肖敬先
// 角色已有权限 List<method*start>java.util.List<method*end><UpmsRolePermission> rolePermissions = upmsApiService.selectUpmsRolePermisstionByUpmsRoleId<method*start>com.vua.upms.rpc.api.UpmsApiService.selectUpmsRolePermisstionByUpmsRoleId<method*end>(id);
conventional
@Override public JSONArray<method*start>com.alibaba.fastjson.JSONArray<method*end> getTreeByRoleId(Integer<method*start>java.lang.Integer<method*end> id) { UpmsSystemExample upmsSystemExample = new UpmsSystemExample(); upmsSystemExample.createCriteria<method*start>com.vua.upms.dao.model.UpmsSystemExample.create...
肖敬先
BirdSession session = authorizeManager.parseSession(exchange); if (StringUtils.equalsIgnoreCase(routeDefinition.getRpcType(), RpcTypeEnum.DUBBO.getName())) { if (BooleanUtils.isNotTrue(routeDefinition.getAnonymous())) { if (session == null) { return jsonResult(exchange, JsonResul...
annotation
@Override protected Mono<Void> doExecute(ServerWebExchange exchange, PipeChain chain, RouteDefinition routeDefinition) { BirdSession session = authorizeManager.parseSession(exchange); } } SessionContext.setSession(session); return chain.execute(exchange); }
肖敬先
basicCheck(comment);
conventional
@PostMapping(value = "/revert") @ResponseBody @SystemLog(description = "回滚评论", type = LogTypeEnum.OPERATION) public JsonResult moveToPublish(@RequestParam("id") Long commentId) { User loginUser = getLoginUser(); // 评论 Comment comment = commentService.get(commentId); // 检查权限 Post post = postService.g...
肖敬先
@LoginPassport if (auth == null || auth.equals("") || (!jwtUtil.getValueFromToken(auth, "role").equals("admin") && !jwtUtil.getValueFromToken(auth, "role").equals("release"))) { k8sConfs.get(i).getItems().get(j).setValue("******"); k8sConfs.get(i).getCurrencyRecord().setConfData("没有权限查看"); for (int h = 0; h...
conventional
@GetMapping(value = "/list") public JsonResult<com.mokn.istio.api.model.domain.JsonResult<com.mokn.istio.api.model.db.K8sConf>> list(@RequestParam(value = "pageNo", required = false) Integer pageNo, @RequestParam(value = "pageSize", required = false) Integer pageSize, @RequestParam(value = "namespace", required = false...
肖敬先
if (CheckPermissionUtil.isNoPermission(authResult.getToken(), request, response, handler, urlPerm)) { throw new UnauthorizedException(); }
conventional
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { // 放行options请求 if (request.getMethod().toUpperCase().equals("OPTIONS")) { CheckPermissionUtil.passOptions(response); return false; } Method method = null; i...
肖敬先
if (authResult == null) { throw new RuntimeException("'" + authCenterUrl + "/authentication' return null"); } else if (AuthResult.CODE_EXPIRED == authResult.getCode()) { throw new ExpiredTokenException(); } else if (AuthResult.CODE_OK != authResult.getCode()) { throw new ErrorTokenE...
conventional
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { // 放行options请求 if (request.getMethod().toUpperCase().equals("OPTIONS")) { CheckPermissionUtil.passOptions(response); return false; } Method method = null; i...
肖敬先
if (!BaseUtil.getUserId<method*start>com.kakarote.crm9.utils.BaseUtil.getUserId<method*end>().equals<method*start>java.lang.Long.equals<method*end>(BaseConstant.SUPER_ADMIN_USER_ID<method*start>com.kakarote.crm9.common.constant.BaseConstant.SUPER_ADMIN_USER_ID<method*end>) && !AuthUtil.isRwAuth<method*start>com.kakarot...
conventional
public R<method*start>com.kakarote.crm9.utils.R<method*end> transfer(CrmBusiness<method*start>com.kakarote.crm9.erp.crm.entity.CrmBusiness<method*end> crmBusiness) { String<method*start>java.lang.String<method*end>[] businessIdsArr = crmBusiness.getBusinessIds<method*start>com.kakarote.crm9.erp.crm.entity.CrmBusine...
肖敬先
if (menuIds.contains(sysMenu.getId().toString())) { treeMenuAllowAccess.setAllowAccess(1); } if (sysMenu.getDeep() < 3) { treeMenuAllowAccess.setChildren(selectTreeMenuAllowAccessByMenuIdsAndPid(menuIds, sysMenu.getId().toString())); }
conventional
@Override public List<method*start>java.util.List<method*end><TreeMenuAllowAccess<method*start>com.github.vole.portal.model.vo.TreeMenuAllowAccess<method*end>> selectTreeMenuAllowAccessByMenuIdsAndPid(final List<method*start>java.util.List<method*end><String<method*start>java.lang.String<method*end>> menuIds, String<me...
肖敬先
// 判断是否有权限 if (isAuthorized<method*start>com.honvay.cola.cloud.upm.service.impl.SysResourceServiceImpl.isAuthorized<method*end>(child.getCode()))
conventional
private List<method*start>java.util.List<method*end><SysResourceTreeNode<method*start>com.honvay.cola.cloud.upm.model.SysResourceTreeNode<method*end>> getResourceTree(Long<method*start>java.lang.Long<method*end> pid) { List<method*start>java.util.List<method*end><SysResourceTreeNode<method*start>com.honvay.cola.clo...
肖敬先
User user = (User) session.getAttribute(Const.CURRENT_USER); if (user == null) { return ServerResponse.createByErrorCodeMessage(ResponseCode.NEED_LOGIN.getCode(), "用户未登录,请登录管理员"); } if (iUserService.checkAdminRole(user).isSuccess()) { // 填充业务 return iProductService.searchProduct(prod...
conventional
@RequestMapping("search.do") public ServerResponse productSearch(HttpSession session, String productName, Integer productId, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) { User user = (User) session.getAttribute(Const.CURRENT_...
肖敬先
// 权限校验 XxlApiProject xxlApiProject = xxlApiProjectDao.load(existGroup.getProjectId()); if (!hasBizPermission(request, xxlApiProject.getBizId())) { return new ReturnT(ReturnT.FAIL_CODE, "您没有相关业务线的权限,请联系管理员开通"); }
conventional
@RequestMapping("/update") @ResponseBody public ReturnT<String> update(HttpServletRequest request, XxlApiGroup xxlApiGroup) { // exist XxlApiGroup existGroup = xxlApiGroupDao.load(xxlApiGroup.getId()); if (existGroup == null) { return new ReturnT(ReturnT.FAIL_CODE, "更新失败,分组ID非法"); } // vali...
万爽
if (list1 == null) { throw new XmallException("查询角色权限失败"); } for (TbRolePerm tbRolePerm : list1) { if (tbRolePermMapper.deleteByPrimaryKey(tbRolePerm.getId()) != 1) { throw new XmallException("删除角色权限失败"); } }
conventional
@Override public int deleteRole(int id) { List<String> list = tbRoleMapper.getUsedRoles(id); if (list == null) { throw new XmallException("查询用户角色失败"); } if (list.size() > 0) { return 0; } if (tbRoleMapper.deleteByPrimaryKey(id) != 1) { throw new XmallException("删除角色失败"); ...
万爽
@RequiresPermissions<method*start>org.apache.shiro.authz.annotation.RequiresPermissions<method*end>("sys:dept:list")
annotation
@ApiOperation<method*start>io.swagger.annotations.ApiOperation<method*end>(value = "部门树列表", response<method*start>io.swagger.annotations.ApiOperation.response<method*end> = Response.class, notes<method*start>io.swagger.annotations.ApiOperation.notes<method*end> = "权限编码(sys:dept:list)") @GetMapping<method*start>org.spri...
万爽
if (authRule != null && authRule.length() > 0) { List<String> authRules = authLoginService.listRuleByAdminId(adminId); // admin 为最高权限 for (String item : authRules) { if (item.equals("admin") || item.equals(authRule)) { return; } } throw...
conventional
private void authRuleVerify(String authRule, Long adminId) { }
万爽
// 是否进行权限验证。 properties.setProperty("mail.smtp.auth", "true"); // 0.2确定权限(账号和密码) Authenticator authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } ...
conventional
@Override public Session instance() { // 如果session已经存在了,就不执行了,直接返回对象 if (session != null) return session; // session为空,判断系统是否配置了邮箱相关的参数,配置了继续,没配置白白 SystemConfig systemConfigHost = systemConfigService.selectByKey("mail_host"); String host = systemConfigHost.getValue(); SystemConfig system...
万爽
@Permission(Const.ADMIN_NAME)
annotation
@RequestMapping("/setAuthority") @BussinessLog(value = "配置权限", key = "roleId,ids", dict = RoleDict.class) @ResponseBody public Tip setAuthority(@RequestParam("roleId") Integer roleId, @RequestParam("ids") String ids) { if (ToolUtil.isOneEmpty(roleId)) { throw new GunsException(BizExceptionEnum.REQUEST_NULL)...
万爽
@RequiresPermissions<method*start>org.apache.shiro.authz.annotation.RequiresPermissions<method*end>("sys:config:save")
annotation
@Log("保存配置") @ApiOperation<method*start>io.swagger.annotations.ApiOperation<method*end>(value = "保存配置", response<method*start>io.swagger.annotations.ApiOperation.response<method*end> = Response.class, notes<method*start>io.swagger.annotations.ApiOperation.notes<method*end> = "权限编码(sys:config:save)") @PostMapping<method...
万爽
if (loginUser == null) { request.setAttribute("msg", "没有权限, 请先登录!"); request.getRequestDispatcher("/index.html").forward(request, response); return false; }
conventional
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { Object loginUser = request.getSession().getAttribute("loginUser"); return true; }
万爽
Permission permission = permissionService.findPermissionById(id); if (permission == null) { modelMap.addAttribute("message", "该权限不存在"); return theme.getAdminTemplate("common/message_tip"); }
conventional
@GetMapping(value = "/permission_update/{id}") public String updatePermissions(@PathVariable Long id, ModelMap modelMap) { modelMap.put("permission", permission); modelMap.addAttribute("admin", getAdminUser()); return theme.getAdminTemplate("admin/admin_permission_update"); }
万爽
int id = Integer.valueOf(username); User user = userMapper.getById(id); if (user == null) { log.info("登录用户id不存在:{}", username); throw new UsernameNotFoundException("用户名 " + username + "不存在"); } // 获取用户权限 List<GrantedAuthority> authorities = new ArrayList<>(); List<Jurisdictio...
conventional
@Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { log.info("登录用户id为:{}", username); user.setAuthorities(authorities); log.info("获取用户{}信息成功,权限为:{}", username, authorities); return user; }
万爽
// 验证用户 User user = userService.find(input); if (user == null) { model.addAttribute("error", "username or password is wrong."); return "redirect:/"; } // 授权 String token = UUID.randomUUID().toString(); request.getSession().setAttribute(AuthConst.IS_LOGIN, true); request.getSession().setAttribute(AuthConst.TOKEN...
conventional
@RequestMapping("/login") public String login(HttpServletRequest request, User input, Model model) { String token = UUID.randomUUID().toString(); request.getSession().setAttribute(AuthConst.IS_LOGIN, true); request.getSession().setAttribute(AuthConst.TOKEN, token); SessionStorage.INSTANCE.set(token, re...
万爽
if (e instanceof UnauthorizedException<method*start>org.apache.shiro.authz.UnauthorizedException<method*end>) { // 请登录 log.error<method*start>org.slf4j.Logger.error<method*end>("无权访问", e); return new ModelAndView<method*start>org.springframework.web.servlet.ModelAndView<method*end>("common/e...
conventional
@ExceptionHandler<method*start>org.springframework.web.bind.annotation.ExceptionHandler<method*end>(value<method*start>org.springframework.context.annotation.PropertySource.value<method*end> = Exception<method*start>java.lang.Exception<method*end>.class) public ModelAndView<method*start>org.springframework.web.servlet....
万爽
// 权限 if (!hasBizPermission(request, project.getBizId())) { throw new RuntimeException("您没有相关业务线的权限,请联系管理员开通"); }
conventional
@RequestMapping("/addPage") public String addPage(HttpServletRequest request, Model model, int projectId, @RequestParam(required = false, defaultValue = "0") int groupId) { // project XxlApiProject project = xxlApiProjectDao.load(projectId); if (project == null) { throw new RuntimeException("操作失败,项目...
万爽
if (sessionUser != null) { return true; }
conventional
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { WxWebUser sessionUser = WxWebUtils.getWxWebUserFromSession(request); String code = request.getParameter("code"); String state = request.getParameter("state"); if (!StringUtils...
万爽
if (stepNode == null) { throw new NoRecordFoundException<method*start>com.rebuild.server.helper.cache.NoRecordFoundException<method*end>("记录不存在或无权查看:" + this.record<method*start>com.rebuild.server.business.approval.ApprovalProcessor.record<method*end>); }
conventional
private String<method*start>java.lang.String<method*end> getCurrentNodeId() { Object<method*start>java.lang.Object<method*end>[] stepNode = Application.getQueryFactory<method*start>com.rebuild.server.Application.getQueryFactory<method*end>().unique<method*start>com.rebuild.server.service.query.QueryFactory.unique<m...
万爽
http.antMatcher("/**").authorizeRequests().anyRequest().authenticated().withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() { @Override public <O extends FilterSecurityInterceptor> O postProcess(O o) { // 动态获取url权限配置 o.setSecurityMetadataSource(filterInv...
conventional
protected void configure(HttpSecurity http) throws Exception { // 关闭csrf验证(防止跨站请求伪造攻击) http.csrf().disable(); // 未登录时:返回状态码401 http.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint); // 无权访问时:返回状态码403 http.exceptionHandling().accessDeniedHandler(accessDeniedHandler); // ...
万爽
if (blogger == null) { log.info("无权限------->403.html"); return "errors/403"; }
conventional
@RequestMapping("/main") public String main() { Blogger blogger = (Blogger) SecurityUtils.getSubject().getSession().getAttribute("currentUser"); log.info("正常登录----->main.html"); return "main"; }
万爽
// 权限申请 AndPermission.with<method*start>com.yanzhenjie.permission.AndPermission.with<method*end>(mContext<method*start>com.loubii.account.ui.avtivity.BaseActivity.mContext<method*end>).requestCode<method*start>com.yanzhenjie.permission.option.Option.requestCode<method*end>(100).permission(Manifest.permission.READ_C...
conventional
private void deleteCalender() { CalenderRemind.deleteCalendarEvent<method*start>com.loubii.account.util.CalenderRemind.deleteCalendarEvent<method*end>(mContext<method*start>com.loubii.account.ui.avtivity.BaseActivity.mContext<method*end>, "test"); }
万爽
if (userRoles != null)
conventional
@Override public void assertIsSystemAdmin(String userName) throws SaturnJobConsoleException { if (!isAuthorizationEnabled()) { return; } User user = getUser(userName); List<UserRole> userRoles = user.getUserRoles(); for (UserRole userRole : userRoles) { if (systemAdminR...
万爽
// 检查用户所传递的 token 是否合法 String<method*start>java.lang.String<method*end> token = getUserToken<method*start>com.xys.demo1.HttpAopAdviseDefine.getUserToken<method*end>(request); if (!token.equalsIgnoreCase<method*start>java.lang.String.equalsIgnoreCase<method*end>("123456")) { return "错误, 权限不合法!"; }
conventional
@Around<method*start>org.aspectj.lang.annotation.Around<method*end>("pointcut()") public Object<method*start>java.lang.Object<method*end> checkAuth(ProceedingJoinPoint<method*start>org.aspectj.lang.ProceedingJoinPoint<method*end> joinPoint) throws Throwable<method*start>java.lang.Throwable<method*end> { HttpServlet...
万爽
// 登陆者的权限 if (user.getId() == null) { session.removeAttribute(Globals.USER_SESSION); modelAndView.setView(new RedirectView("loginController.do?login")); }
conventional
@RequestMapping(params = "left") public ModelAndView left(HttpServletRequest request) { TSUser user = ResourceUtil.getSessionUser(); HttpSession session = ContextHolderUtils.getSession(); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("main/left"); request.setAttribute("...
万爽
if (user == null) { throw new UsernameNotFoundException("用户不存在"); } // 如果是管理员则有所有权限 if (user.isIssys()) { auths = staffService.loadAllAuthorities(); }
conventional
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { Collection<GrantedAuthority> auths = new ArrayList<GrantedAuthority>(); // 根据用户名取得一个SysUsers对象,以获取该用户的其他信息。 SysUsers user = staffService.findByUserAccount(username); // 得到用户的权限 ...
万爽
@RequiresPermissions("permission:insert")
annotation
@ApiOperation(value = "新增权限", httpMethod = "POST", produces = "application/json", response = Result.class) @ResponseBody @RequestMapping(value = "insert", method = RequestMethod.POST) public Result insert(@RequestParam long groupId, @RequestParam String name, @RequestParam String code, @RequestParam String description,...
万爽
if (activity.checkCallingOrSelfPermission<method*start>android.app.Activity.checkCallingOrSelfPermission<method*end>(Manifest.permission.INTERNET<method*start>android.Manifest.permission.INTERNET<method*end>) != PackageManager.PERMISSION_GRANTED<method*start>android.content.pm.PackageManager.PERMISSION_GRANTED<meth...
conventional
private void authorize(Activity<method*start>android.app.Activity<method*end> activity, String<method*start>java.lang.String<method*end>[] permissions, boolean isForceLogin, boolean isConfirmLogin, final BaiduDialogListener<method*start>com.baidu.duer.dcs.oauth.api.BaiduDialog.BaiduDialogListener<method*end> listener, ...
万爽
@RequiresPermissions("配置管理:权限管理:后台用户管理")
annotation
@MetaData(value = "汇总用户关联权限集合") @RequestMapping(value = "/privileges", method = RequestMethod.GET) public String privileges(Model model, User entity) { Set<Long> r2PrivilegeIds = Sets.newHashSet(); List<Privilege> privileges = privilegeService.findAllCached(); List<UserR2Role> userR2Roles = entity.getUserR2...
万爽
@RequiresPermissions<method*start>org.apache.shiro.authz.annotation.RequiresPermissions<method*end>("oss:water:setting")
annotation
@Log(value = "修改水印", update<method*start>com.king.common.annotation.Log.update<method*end> = true, serviceClass<method*start>com.king.common.annotation.Log.serviceClass<method*end> = OssDoc2pdfService.class, method<method*start>com.king.common.annotation.Log.method<method*end> = "queryWaterSetting") @ApiOperation<metho...
万爽
// 检查该权限是否已经获取 if (!checkPermission(context, permission)) { noPermission.add<method*start>java.util.List.add<method*end>(permission); }
conventional
@RequiresApi<method*start>android.support.annotation.RequiresApi<method*end>(api<method*start>android.support.annotation.RequiresApi.api<method*end> = Build.VERSION_CODES.M<method*start>android.os.Build.VERSION_CODES.M<method*end>) public static String<method*start>java.lang.String<method*end>[] checkPermission(Context...
万爽
@RequiresPermissions("配置管理:权限管理:部门配置")
annotation
@RequestMapping(value = "/tree", method = RequestMethod.GET) @ResponseBody public MappingJacksonValue findTreeData(GroupPropertyFilter filter, Pageable pageable, HttpServletRequest request) { filter.forceAnd(new PropertyFilter(MatchType.NE, "disabled", true)); Object value = departmentService.findByPage(filter,...
肖敬先
@RequiresPermissions(value = { "resource:batchDelete", "resource:delete" }, logical = Logical.OR)
annotation
@PostMapping(value = "/remove") @BussinessLog("删除资源") public ResponseVO<com.zyd.blog.framework.object.ResponseVO> remove(Long[] ids) { if (null == ids) { return ResultUtil.error(500, "请至少选择一条记录"); } for (Long id : ids) { resourcesService.removeByPrimaryKey(id); } // 更新权限 shiroSer...
肖敬先
if (!TextUtils.isEmpty(wxAuthorizationVo.getErrorMsg())) { return Response.error(wxAuthorizationVo.getErrorCode(), wxAuthorizationVo.getErrorMsg()); }
conventional
@PostMapping(value = "/authentication") public Response authentication(HttpServletRequest request, @RequestBody JSONObject json) { // 邀请者的openId String openId = json.getString("openId"); // 微信授权码 String code = json.getString("code"); AuthorizationVo wxAuthorizationVo = authenticationService.authentication(request, ...
万爽
// 无权限 if (exception instanceof UnauthorizedException<method*start>org.apache.shiro.authz.UnauthorizedException<method*end>) { return "/403.jsp"; } // shiro session 过期 if (exception instanceof InvalidSessionException<method*start>org.apache.shiro.session.InvalidSessionException<method*end>) { return "/error.jsp...
conventional
@ExceptionHandler<method*start>org.springframework.web.bind.annotation.ExceptionHandler<method*end> public String<method*start>java.lang.String<method*end> exceptionHandler(HttpServletRequest<method*start>javax.servlet.http.HttpServletRequest<method*end> request, HttpServletResponse<method*start>javax.servlet.http.Http...
万爽
@RequiresPermissions("permission:group:insert")
annotation
@ApiOperation(value = "新增权限组", httpMethod = "POST", produces = "application/json", response = Result.class) @ResponseBody @RequestMapping(value = "group/insert", method = RequestMethod.POST) public Result insertGroup(@RequestParam String name, @RequestParam String description) { boolean isExistGroupName = sysPermis...
万爽
@PreAuthorize("hasAnyAuthority('ROLE_ADMIN','ROLE_USER','ROLE_VISTOR')")
annotation
@PostMapping public ResponseEntity<Response<com.whichard.spring.boot.blog.vo.Response>> createVote(Long blogId) { try { blogService.createVote(blogId); } catch (ConstraintViolationException e) { return ResponseEntity.ok().body(new Response(false, ConstraintViolationExceptionHandler.getMessage(e)...
万爽
@RequiresPermissions("membership.permission:view")
annotation
@GetMapping(value = "/list") @OpLog(name = "获取权限列表") public Map<String, Object> list(final DataGridPager pager, final Integer id) { final int moduleId = (id == null ? 0 : id); final PageInfo pageInfo = pager.toPageInfo(); final List<Permission> list = this.service.getByPage(pageInfo, moduleId); final Ma...
万爽
SmsStaff staff = smsStaffService.selectByUserName(username); if (staff != null)
conventional
@Bean public UserDetailsService userDetailsService() { // 获取登录用户信息 return username -> { // 保证了User存在且状态不为0 SmsStaff staff = smsStaffService.selectByUserName(username); if (staff != null) { // 拉取权限 List<SmsPermission> permissionList = smsRoleService.getPermissionLi...
万爽
Boolean status = authService.domainAuth(request, domainId, "r").getStatus(); if (status) { return Hret.error(403, "您没有被授权访问域【" + domainId + "】", null); }
conventional
@RequestMapping(value = "/details", method = RequestMethod.GET) @ApiOperation(value = "查询域的详细信息", notes = "查询某一个指定域的详细定义信息,如果请求的参数为空,则返回用户自己所在域的详细信息") @ApiImplicitParams({ @ApiImplicitParam(required = true, name = "domain_id", value = "域编码") }) public String getDomainDetails(HttpServletRequest request) { String dom...
万爽
authRuleVerify<method*start>com.lmxdawn.api.admin.aspect.AuthorizeAspect.authRuleVerify<method*end>(action.value<method*start>com.lmxdawn.api.admin.annotation.AuthRuleAnnotation.value<method*end>(), adminId);
conventional
@Before<method*start>org.aspectj.lang.annotation.Before<method*end>("adminLoginVerify()") public void doAdminAuthVerify(JoinPoint<method*start>org.aspectj.lang.JoinPoint<method*end> joinPoint) { ServletRequestAttributes<method*start>org.springframework.web.context.request.ServletRequestAttributes<method*end> attrib...
万爽
if (!isOwner) { return ResponseEntity.ok().body(new Response(false, "没有操作权限")); }
conventional
@DeleteMapping("/{id}") public ResponseEntity<Response<com.whichard.spring.boot.blog.vo.Response>> delete(@PathVariable("id") Long id, Long blogId) { boolean isOwner = false; User user = voteService.getVoteById(id).getUser(); if (SecurityContextHolder.getContext().getAuthentication() != null && SecurityCont...
万爽
Boolean status = authService.domainAuth(request, domainId, "r").getStatus(); if (status) { return Hret.error(403, "您没有被授权访问域【" + domainId + "】", null); }
conventional
@RequestMapping(value = "/details", method = RequestMethod.GET) @ApiOperation(value = "查询域的详细信息", notes = "查询某一个指定域的详细定义信息,如果请求的参数为空,则返回用户自己所在域的详细信息") @ApiImplicitParams({ @ApiImplicitParam(required = true, name = "domain_id", value = "域编码") }) public String getDomainDetails(HttpServletRequest request) { String dom...
肖敬先
// 查询项目,同时校验用户权限 MetaProjectPO<method*start>com.youran.generate.pojo.po.MetaProjectPO<method*end> project = metaProjectService.getAndCheckProject<method*start>com.youran.generate.service.MetaProjectService.getAndCheckProject<method*end>(metaField.getProjectId<method*start>com.youran.generate.pojo.po.MetaFieldPO.getPro...
conventional
@Transactional<method*start>org.springframework.transaction.annotation.Transactional<method*end>(rollbackFor<method*start>org.springframework.transaction.annotation.Transactional.rollbackFor<method*end> = RuntimeException<method*start>java.lang.RuntimeException<method*end>.class) @OptimisticLock<method*start>com.youran...
肖敬先
List<method*start>java.util.List<method*end><GrantType<method*start>com.github.vole.mps.constants.GrantType<method*end>> grantTypes = new ArrayList<method*start>java.util.ArrayList<method*end><GrantType<method*start>com.github.vole.mps.constants.GrantType<method*end>>(); GrantType<method*start>com.github.vole.mps.c...
conventional
public static List<method*start>java.util.List<method*end><GrantType<method*start>com.github.vole.mps.constants.GrantType<method*end>> list() { return grantTypes; }
肖敬先
@AuthRuleAnnotation("admin/auth/role/auth")
annotation
@PostMapping("/admin/auth/role/auth") public BaseResponse<method*start>com.lmxdawn.api.common.res.BaseResponse<method*end> auth(@RequestBody @Valid AuthRoleAuthRequest authRoleAuthRequest, BindingResult<method*start>org.springframework.validation.BindingResult<method*end> bindingResult) { if (bindingResult.hasError...
肖敬先
if (id == 1) { return data = DataVo.failure("超级管理员组不能删除"); }
conventional
@PostMapping("/group_del") @ResponseBody public DataVo deleteGroup(@RequestParam(value = "id") Long id) { DataVo data = DataVo.failure("操作失败"); if (groupService.deleteGroup(id)) { data = DataVo.success("该权限组已删除"); } else { data = DataVo.failure("删除失败或者不存在!"); } return data; }
肖敬先
if (imMgr.validation(userID, token) != 0) { rsp.setCode(7); rsp.setMessage("请求失败,鉴权失败"); log.error("setCustomInfo失败:鉴权失败:" + "userID:" + userID); return rsp; }
conventional
@Override public GetCustomInfoRsp setCustomInfo(String userID, String token, SetCustomInfoReq req, int type) { GetCustomInfoRsp rsp = new GetCustomInfoRsp(); String roomID = req.getRoomID(); String fieldName = req.getFieldName(); String operation = req.getOperation(); if (userID == null || token == ...
肖敬先
if (map == null || map.size() == 0 || !map.containsKey(0)) { return "不具有任何权限,\n请找管理员分配权限"; }
conventional
public static String getHplusMultistageTree(Map map) { StringBuffer menuString = new StringBuffer(); List list = map.get(0); int curIndex = 0; for (TSFunction function : list) { menuString.append("<li>"); if (function.getFunctionIconStyle() != null && !function.getFunctionIconStyle(...
肖敬先
@RequiresPermissions("oss:pdf:view")
annotation
@ApiOperation(value = "pdf预览", notes = "权限编码(oss:pdf:view)") @GetMapping("/view") public void pdfViewer(HttpServletRequest request, HttpServletResponse response) { // 不进行xss过滤 HttpServletRequest orgRequest = XssHttpServletRequestWrapper.getOrgRequest(request); String urlpath = orgRequest.getParameter("urlpa...
肖敬先
if (!checkAllow(user, fileId)) { writeFailure(response, "无权删除他人文件"); return; }
conventional
@RequestMapping("delete-files") public void deleteFiles(HttpServletRequest request, HttpServletResponse response) throws IOException { ID user = getRequestUser(request); String[] files = getParameter(request, "ids", "").split(","); Set<ID> willDeletes = new HashSet<>(); for (String file : files) { ...
肖敬先
// 未登录,无权上传图片 if (user == null) { log.warn<method*start>org.slf4j.Logger.warn<method*end>("member fck upload warn: not logged in.");
conventional
private UploadResponse<method*start>foo.common.fck.UploadResponse<method*end> validateUpload(HttpServletRequest<method*start>javax.servlet.http.HttpServletRequest<method*end> request, String<method*start>java.lang.String<method*end> commandStr, String<method*start>java.lang.String<method*end> typeStr, String<method*sta...
万爽
if (command.getGmLevel() > gmLevel) { return "你没有权限执行此GM命令"; }
conventional
private String execGmCmd(Session session, String gmStr, int gmLevel) { gmStr = gmStr.substring(1); String[] commandArray = gmStr.split(" "); GMCommand command = GMCommand.getCommand(commandArray[0]); if (command == null) { return "没有对应GM命令"; } Gm gm = GMCommand.getGm(command); S...
万爽
// 检查权限 basicCheck(comment);
conventional
@PostMapping(value = "/revert") @ResponseBody @SystemLog(description = "回滚评论", type = LogTypeEnum.OPERATION) public JsonResult moveToPublish(@RequestParam("id") Long commentId) { User loginUser = getLoginUser(); // 评论 Comment comment = commentService.get(commentId); // 检查权限 basicCheck(comment); ...
肖敬先
if (validate(ctx, perms)) return fc.next(ctx);
conventional
@Override public Object filterRuleMethod(FilterChain fc, RuleServiceFilterContext ctx) throws Throwable { // 获取方法名 String mn = ctx.getMethod().getName(); // 获取授权列表 String[] perms; Map<String, String[]> clazzMap = this.permissionMap.get(ctx.getObject().getClass()); if (clazzMap == null) { ...
肖敬先
if (interfaceRuleDto == null) { return Result.error<method*start>org.jeecgframework.jwt.util.Result.error<method*end>("您没有该接口的权限!"); }
conventional
@ApiOperation<method*start>io.swagger.annotations.ApiOperation<method*end>(value<method*start>org.springframework.context.annotation.Scope.value<method*end> = "黑名单列表数据", produces<method*start>io.swagger.annotations.ApiOperation.produces<method*end> = "application/json", httpMethod<method*start>io.swagger.annotations.Ap...
万爽
if (auth == null || auth.equals("") || (!jwtUtil.getValueFromToken(auth, "role").equals("admin") && !jwtUtil.getValueFromToken(auth, "role").equals("release"))) { k8sConfs.get(i).getItems().get(j).setValue("******"); k8sConfs.get(i).getCurrencyRecord().setConfData("没有权限查看"); ...
annotation
@GetMapping(value = "/list") public JsonResult<K8sConf<com.mokn.istio.api.model.db.K8sConf>> list(@RequestParam(value = "pageNo", required = false) Integer pageNo, @RequestParam(value = "pageSize", required = false) Integer pageSize, @RequestParam(value = "namespace", required = false) String namespace, @RequestParam(v...
万爽
// 检查是否忽略权限验证 if (method == null || CheckPermissionUtil.checkIgnore(method)) { return super.preHandle(request, response, handler); } // 检查权限 if (CheckPermissionUtil.isNoPermission(authResult.getToken(), request, response, handler, urlPerm))
conventional
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { // 放行options请求 if (request.getMethod().toUpperCase().equals("OPTIONS")) { CheckPermissionUtil.passOptions(response); return false; } Method method = null; i...
万爽
if (!BaseUtil.getUserId().equals(BaseConstant.SUPER_ADMIN_USER_ID) && !AuthUtil.isRwAuth(Integer.parseInt(businessId), "business")) { return R.error("无权限转移"); }
conventional
public R transfer(CrmBusiness crmBusiness) { String[] businessIdsArr = crmBusiness.getBusinessIds().split(","); for (String businessId : businessIdsArr) { if (!BaseUtil.getUserId().equals(BaseConstant.SUPER_ADMIN_USER_ID) && !AuthUtil.isRwAuth(Integer.parseInt(businessId), "business")) { ret...
万爽
Assert.isTrue<method*start>org.springframework.util.Assert.isTrue<method*end>(Application.getSecurityManager<method*start>com.rebuild.server.Application.getSecurityManager<method*end>().allow<method*start>com.rebuild.server.service.bizz.privileges.SecurityManager.allow<method*end>(user, ZeroEntry.AllowBatchUpdate<metho...
conventional
@RequestMapping<method*start>org.springframework.web.bind.annotation.RequestMapping<method*end>("batch-update/submit") public void submit(@PathVariable String entity, HttpServletRequest<method*start>javax.servlet.http.HttpServletRequest<method*end> request, HttpServletResponse<method*start>javax.servlet.http.HttpServle...
万爽
if (menuIds.contains(sysMenu.getId().toString())) { treeMenuAllowAccess.setAllowAccess(1); } if (sysMenu.getDeep() < 3) { treeMenuAllowAccess.setChildren(selectTreeMenuAllowAccessByMenuIdsAndPid(menuIds, sysMenu.getId().toString())); }
conventional
@Override public List<method*start>java.util.List<method*end><TreeMenuAllowAccess<method*start>com.github.vole.portal.model.vo.TreeMenuAllowAccess<method*end>> selectTreeMenuAllowAccessByMenuIdsAndPid(final List<method*start>java.util.List<method*end><String<method*start>java.lang.String<method*end>> menuIds, String<me...
万爽
if (parameters.length == 0) { // 什么都没有,无法判断权限 return null; } Object object = parameters[0]; if (!(object instanceof BaseUserContext)) { // 第一个不是,也无法判断权限,通常这样的方法不允许在manager方法出现 return null; }
conventional
protected String targetIdOf(String methodName, Object[] parameters) { if (parameters.length == 1) { // 只有UC,没有其他参数 return null; } // 第一个是UC,而且至少有第二个参数,而且是String,而且方法的名字不是deleteAll和create,都应该是第二个 int index = indexOfTargetId(methodName); if (index < 0) { // 不存在targetId ...
万爽
if (EntityHelper.hasPrivilegesField(entity)) { Permission[] actions = new Permission[] { BizzPermission.CREATE, BizzPermission.DELETE, BizzPermission.UPDATE, BizzPermission.READ, BizzPermission.ASSIGN, BizzPermission.SHARE }; Map<String, Boolean> actionMap = new HashMap<>(); for (Permission act ...
conventional
protected ModelAndView createModelAndView(String page, ID record, ID user) { ModelAndView mv = createModelAndView(page); Entity entity = MetadataHelper.getEntity(record.getEntityCode()); putEntityMeta(mv, entity); // 使用主实体权限 if (entity.getMasterEntity() != null) { entity = entity.getMasterEn...
万爽
if (null == aclDO) { throw BizException.fail("待查询的权限不存在"); }
conventional
public AclDetailRes detail(AclReq aclReq) { AclDO aclDO = aclMapper.selectByPrimaryUuid(aclReq.getUuid()); AclDetailRes aclDetailRes = new AclDetailRes(); BeanUtils.copyProperties(aclDO, aclDetailRes); if (aclDO.getSysAclType().equals(AclTypeEnum.system.type)) { int count = aclMapper.c...
万爽
for (RoleEntity m : list) { AuthDTO authDTO = authService.domainAuth(request, m.getDomain_id(), "w"); if (!authDTO.getStatus()) { return Hret.error(403, "您没有权限删除域【" + m.getDomain_id() + "】中的角色信息", null); if (!authDTO.getStatus()) { return Hret.error(403, "您没有权限删除域【" + m.getD...
conventional
@RequestMapping(value = "/delete", method = RequestMethod.POST) public String delete(HttpServletResponse response, HttpServletRequest request) { String json = request.getParameter("JSON"); List<RoleEntity> list = new GsonBuilder().create().fromJson(json, new TypeToken<List<RoleEntity>>() {}.getType()); for ...
万爽
@Authorize(merge = false) if (!old.hasPermission(RW, R)) { throw new AccessDenyException("没有权限保存此配置"); }
conventional
@PatchMapping("/me/{key}") @ApiOperation("保存当前用户配置") public ResponseMessage save(Authentication authentication, @PathVariable String key, @Validated @RequestBody UserSettingEntity userSettingEntity) { userSettingEntity.setId(null); userSettingEntity.setUserId(authentication.getUser().getId()); userSettingEn...
肖敬先
AccessibleObject.checkPermission();
conventional
@Override @CallerSensitive public void setAccessible(boolean flag) { // 如果需要开启访问权限 if (flag) { // 获取setAccessible()的调用者所处的类 Class<?> caller = Reflection.getCallerClass(); // 判断caller是否可以访问当前元素(涉及到exports和opens的判断) checkCanSetAccessible(caller); } setAccessible0(flag); }
肖敬先
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED)
conventional
public static String getUUID(Context context) { String tmDevice = "", tmSerial = "", tmPhone = "", androidId = ""; { try { final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); tmDevice = "" + tm.getDeviceId(); tmSerial = ...
肖敬先
if (perms != null)
conventional
public static boolean askForBothPermissions(Activity activity) { boolean askCamera = !HiSettingsHelper.getInstance().isCameraPermAsked() && ContextCompat.checkSelfPermission(activity, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED; boolean askStorage = ContextCompat.checkSelfPermission(activit...
肖敬先
// 访问消息页, 判断登录 if (Views.METHOD_MESSAGES.equals(method)) { // 标记已读 AccountProfile profile = getProfile(); if (null == profile || profile.getId() != userId) { throw new MtonsException("您没有权限访问该页面"); } messageService.readed4Me(profile.getId()); }
conventional
@GetMapping(value = "/{userId}/{method}") public String method(@PathVariable(value = "userId") Long userId, @PathVariable(value = "method") String method, ModelMap model, HttpServletRequest request) { model.put("pageNo", ServletRequestUtils.getIntParameter(request, "pageNo", 1)); initUser(userId, mode...
肖敬先
@PreAuthorize("hasAnyAuthority('ROLE_ADMIN','ROLE_USER','ROLE_VISTOR')")
annotation
@PostMapping public ResponseEntity<Response<com.whichard.spring.boot.blog.vo.Response>> createComment(Long blogId, String commentContent) { try { commentContent = sensitiveService.filter(commentContent); blogService.createComment(blogId, commentContent); } catch (ConstraintViolationException e) ...
肖敬先
// 如果设置为所有权限 if (permissionIds.contains("all")) { return "all"; }
conventional
@Override public String getModuleIds(final String permissionIds) { final Map<String, Permission> idMap = new HashMap<>(cache.size()); for (final Permission permission : cache.values()) { idMap.put(permission.getId().toString(), permission); } final String[] idList = StringUtils.split(permis...
肖敬先
if (!hasBizPermission(request, apiDataType.getBizId())) { throw new RuntimeException("您没有相关业务线的权限,请联系管理员开通"); }
conventional
@RequestMapping("/updateDataTypePage") public String updateDataTypePage(HttpServletRequest request, Model model, int dataTypeId) { XxlApiDataType apiDataType = xxlApiDataTypeService.loadDataType(dataTypeId); if (apiDataType == null) { throw new RuntimeException("数据类型ID非法"); } model.addAttribute(...
肖敬先
if (interfaceRuleDto == null) { return Result.error("您没有该接口的权限!"); }
conventional
@ApiOperation(value = "删除黑名单") @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseBody public ResponseMessage<?> delete(@PathVariable("id") String id, HttpServletRequest request) { InterfaceRuleDto interfaceRuleDto = InterfaceUtil.getInterfaceRuleDto(request, InterfaceEnum.blacklist_delete); ...
肖敬先
if (null != authRoles) { if (0 < authRoles.roles<method*start>org.superboot.base.AuthRoles.roles<method*end>().length<method*start>java.lang.String[].length<method*end>) { String<method*start>java.lang.String<method*end>[] roles<method*start>org.superboot.base.AuthRoles.roles<method*end> = authRoles...
conventional
public boolean checkAuthRole(AuthRoles<method*start>org.superboot.base.AuthRoles<method*end> authRoles, BaseToken<method*start>org.superboot.base.BaseToken<method*end> token) { return true; }
万爽
// 登录用户名 model.addAttribute("userName", sessionUser.getAccount()); // 单点退出地址 model.addAttribute("ssologoutUrl", new StringBuilder().append(ssoServerUrl).append("/logout?backUrl=").append(getLocalUrl(request)).toString()); SessionPermission sessionPermission = SessionUtils.getSessionPermission(request); if (sessionPermi...
conventional
@GetMapping("/") public String index(Model model, HttpServletRequest request) { SessionUser sessionUser = SessionUtils.getSessionUser(request); // 登录用户名 model.addAttribute("userName", sessionUser.getAccount()); // 单点退出地址 model.addAttribute("ssologoutUrl", new StringBuilder().append(ssoServerUrl).append("/logout...
万爽
@RequiresPermissions("sys:role:info")
annotation
@ApiOperation(value = "角色信息", response = Response.class, notes = "权限编码(sys:role:info)") @GetMapping("/info/{roleId}") public JsonResponse info(@PathVariable("roleId") Object roleId) { SysRole role = sysRoleService.queryObject(roleId); // 查询角色对应的菜单 List<Long> menuIdList = sysMenuService.queryMenuIdList(roleI...
万爽
if (!granted) { Toast.makeText(this, "请到设置-权限管理中开启", Toast.LENGTH_SHORT).show(); return; }
conventional
@Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); boolean granted = true; for (int i = 0; i < grantResults.length; i++) { if (grantResults[i] != PackageManager.PERMIS...
万爽
if (url.contains("monitoring") || url.contains("druid")) { try { if (ShiroUtils.getUserId() != Constant.SUPER_ADMIN) { accessDenied(res); } } catch (Exception e) { logger.info("没有权限!"); accessDenied(res); } }
conventional
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // 设置跨域 HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; res.setHeader("Access-Control-Allow-Origin",...
万爽
if (entity == null) { chain.resume<method*start>org.openwebflow.assign.TaskAssignmentHandlerChain.resume<method*end>(assigneeExpression, ownerExpression, candidateUserExpressions, candidateGroupExpressions, task, execution); return; }
conventional
@Override public void handleAssignment(TaskAssignmentHandlerChain<method*start>org.openwebflow.assign.TaskAssignmentHandlerChain<method*end> chain, Expression<method*start>org.activiti.engine.delegate.Expression<method*end> assigneeExpression, Expression<method*start>org.activiti.engine.delegate.Expression<method*end> ...
万爽
if (user != null && (user.isAdmin())) { chain.doFilter(req, resp); } else { // 重定向到 无权限执行操作的页面 HttpServletResponse response = (HttpServletResponse) resp; response.sendRedirect("/?msg=security"); } } else { try { chain.doFilt...
conventional
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; boolean matchAnyRoles = false; for (RequestMatcher anyRequest : ignoredRequests) { if (anyRequest.matches(request)) { ...
万爽
Assert.isTrue(Application.getSecurityManager().allow(user, ZeroEntry.AllowCustomNav), "没有权限");
conventional
@RequestMapping(value = "nav-settings", method = RequestMethod.POST) public void sets(HttpServletRequest request, HttpServletResponse response) throws IOException { ID user = getRequestUser(request); JSON config = ServletUtils.getRequestJson(request); ID cfgid = getIdParameter(request, "id"); if (c...
万爽
RedisUser redisUser = this.redisUser(); if (!redisUser.getTenantId().equals(1L)) { throw new BizException("您不是MOMO企业下的VIP,无权操作"); }
conventional
@Override public DataDictLevelRes dataDictTree(DataDictTreeReq dataDictTreeReq) { DataDictLevelRes dataDictLevelRes = new DataDictLevelRes(); List<DataDictDO> dataDiceGetAll = dataDictMapper.dataDiceGetAll(0, dataDictTreeReq.getSysDictCodeParentValue(), dataDictTreeReq.getSysDictCodeParentValue()); if ...
万爽
if (!authDTO.getStatus<method*start>com.asofdate.hauth.dto.AuthDTO.getStatus<method*end>()) { return Hret.error<method*start>com.asofdate.utils.Hret.error<method*end>(403, "您没有权限删除域【" + domainId + "】中的机构信息", null); }
conventional
@RequestMapping<method*start>org.springframework.web.bind.annotation.RequestMapping<method*end>(value<method*start>org.springframework.web.bind.annotation.RequestMapping.value<method*end> = "/delete", method<method*start>org.springframework.web.bind.annotation.RequestMapping.method<method*end> = RequestMethod.POST<meth...
万爽