当前位置: 首页>>代码示例>>Java>>正文


Java ActionType.AUTHENTICATED属性代码示例

本文整理汇总了Java中fr.wseduc.security.ActionType.AUTHENTICATED属性的典型用法代码示例。如果您正苦于以下问题:Java ActionType.AUTHENTICATED属性的具体用法?Java ActionType.AUTHENTICATED怎么用?Java ActionType.AUTHENTICATED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在fr.wseduc.security.ActionType的用法示例。


在下文中一共展示了ActionType.AUTHENTICATED属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBooking

@Get("/booking/:id")
@ApiDoc("find start date of one booking")
@SecuredAction(value = "rbs.booking.one.id", type= ActionType.AUTHENTICATED)
public void getBooking(final HttpServerRequest request) {
    UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
        @Override
        public void handle(final UserInfos user) {
            if (user != null) {
                bookingService.getBooking(request.params().get("id"), new Handler<Either<String, JsonObject>>() {
                    @Override
                    public void handle(Either<String, JsonObject> event) {
                        if (event.isRight()) {
                            Renders.renderJson(request,  event.right().getValue());
                        } else {
                            Renders.renderError(request, new JsonObject().putString("error", event.left().getValue()));
                        }
                    }
                });
            } else {
                log.debug("User not found in session.");
                unauthorized(request);
            }
        }
    });
}
 
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:25,代码来源:BookingController.java

示例2: getUserInfos

@Get("/getUserInfo/:mxcId")
@SecuredAction(type = ActionType.AUTHENTICATED, value = "")
public void getUserInfos(final HttpServerRequest request){
	final String soapAction = "getUserInfo";
	final String mxcId = request.params().get("mxcId");

	if(mxcId == null || mxcId.trim().length() == 0){
		badRequest(request);
		return;
	}

	SoapHelper.SoapDescriptor messageDescriptor = new SoapHelper.SoapDescriptor(soapAction);
	messageDescriptor
		.addNamespace("urn","urn:mxc-wsdl")
		.setBodyNamespace("", "urn")
		.createElement("mxcId", mxcId)
			.addAttribute("xsi:type", "xsd:long");

	processMessage(request, messageDescriptor);
}
 
开发者ID:OPEN-ENT-NG,项目名称:aide-aux-devoirs,代码行数:20,代码来源:MaxicoursController.java

示例3: getQuota

/**
 * Returns the associated data.
 * @param request Client request containing the id.
 */
@Get("/quota")
@SecuredAction(value = read_only, type = ActionType.AUTHENTICATED)
public void getQuota(final HttpServerRequest request) {
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
			if (user != null) {
				shareBigFilesService.getQuotaData(user.getUserId(), new Handler<JsonObject>() {
					@Override
					public void handle(JsonObject event) {
						if ("ok".equals(event.getString("status"))) {
							final JsonObject result = event;
							getResidualRepositorySize(new Handler<Long>() {
								@Override
								public void handle(Long residualRepositorySize) {
									result.removeField("status");
									result.putNumber("maxFileQuota", ShareBigFilesController.this.maxQuota);
									result.putNumber("maxRepositoryQuota", ShareBigFilesController.this.maxRepositoryQuota);
									result.putNumber("residualRepositoryQuota",
											residualRepositorySize);
									Renders.renderJson(request, result);
								}
							});
						} else {
							Renders.renderError(request);
						}
					}
				});
			} else {
				if (log.isDebugEnabled()) {
					log.debug("User not found in session.");
				}
				Renders.unauthorized(request);
			}
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:share-big-files,代码行数:41,代码来源:ShareBigFilesController.java

示例4: list

/**
 * Lists every object associated with the user.
 * @param request Client request.
 */
@Get("/list")
@SecuredAction(value = read_only, type = ActionType.AUTHENTICATED)
public void list(final HttpServerRequest request) {
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
			String filter = request.params().get("filter");
			VisibilityFilter v = VisibilityFilter.ALL;
			if (filter != null) {
				try {
					v = VisibilityFilter.valueOf(filter.toUpperCase());
				} catch (IllegalArgumentException | NullPointerException e) {
					v = VisibilityFilter.ALL;
					if (log.isDebugEnabled()) {
						log.debug("Invalid filter " + filter);
					}
				}
			}

			shareBigFileCrudService.list(v, user, new Handler<Either<String, JsonArray>>() {
				@Override
				public void handle(Either<String, JsonArray> event) {
					if (event.isRight()) {
						Renders.renderJson(request, event.right().getValue());
					} else {
						leftToResponse(request, event.left());
					}
				}

			});
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:share-big-files,代码行数:37,代码来源:ShareBigFilesController.java

示例5: list

@Get("/list")
@SecuredAction(value = "", type = ActionType.AUTHENTICATED)
public void list(final HttpServerRequest request) {
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(UserInfos user) {
			if (user != null) {
				communityService.list(user, arrayResponseHandler(request));
			} else {
				unauthorized(request);
			}
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:14,代码来源:CommunityController.java

示例6: listAllPages

@Get("/listallpages")
@ApiDoc("List communities, visible by current user")
@SecuredAction(value = "", type = ActionType.AUTHENTICATED)
public void listAllPages(final HttpServerRequest request) {
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
			if (user != null) {
				Handler<Either<String, JsonArray>> handler = arrayResponseHandler(request);
				communityService.list(user, handler);
			}
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:14,代码来源:CommunityController.java

示例7: getConf

@Get("/conf")
@SecuredAction(type = ActionType.AUTHENTICATED, value = "")
public void getConf(final HttpServerRequest request){
	JsonObject config = new JsonObject()
		.putString("connectorEndpoint", Config.getConf().getString("connectorEndpoint", ""));

	renderJson(request, config);
}
 
开发者ID:OPEN-ENT-NG,项目名称:aide-aux-devoirs,代码行数:8,代码来源:MaxicoursController.java

示例8: getUserStatus

@Get("/getUserStatus")
@SecuredAction(type = ActionType.AUTHENTICATED, value = "")
public void getUserStatus(final HttpServerRequest request){
	final String soapAction = "getUserStatus";

	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(UserInfos user) {
			if(user == null){
				badRequest(request);
				return;
			}

			SoapHelper.SoapDescriptor messageDescriptor = new SoapHelper.SoapDescriptor(soapAction);
			messageDescriptor
				.addNamespace("urn","urn:mxc-wsdl")
				.setBodyNamespace("", "urn")
				.createElement("entId", user.getUserId())
					.addAttribute("xsi:type", "string");
			List<String> uai = user.getUai();
			if(uai.size() > 0)
				messageDescriptor
					.createElement("etaRne", uai.get(0))
					.addAttribute("xsi:type", "string");

			processMessage(request, messageDescriptor);
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:aide-aux-devoirs,代码行数:29,代码来源:MaxicoursController.java

示例9: getExpirationList

@Get("/expirationDateList")
@SecuredAction(value = read_only, type = ActionType.AUTHENTICATED)
public void getExpirationList(final  HttpServerRequest request) {
	renderJson(request, new JsonObject().putArray("expirationDateList", expirationDateList));
}
 
开发者ID:OPEN-ENT-NG,项目名称:share-big-files,代码行数:5,代码来源:ShareBigFilesController.java


注:本文中的fr.wseduc.security.ActionType.AUTHENTICATED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。