本文整理汇总了Java中fr.wseduc.security.SecuredAction类的典型用法代码示例。如果您正苦于以下问题:Java SecuredAction类的具体用法?Java SecuredAction怎么用?Java SecuredAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecuredAction类属于fr.wseduc.security包,在下文中一共展示了SecuredAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Post("")
@SecuredAction("community.create")
public void create(final HttpServerRequest request) {
RequestUtils.bodyToJson(request, pathPrefix + "create", new Handler<JsonObject>() {
@Override
public void handle(final JsonObject body) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
CommunityController.this.create(user, request, body);
} else {
unauthorized(request);
}
}
});
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:20,代码来源:CommunityController.java
示例2: update
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Put("/:id")
@SecuredAction(value = "", type = ActionType.RESOURCE)
public void update(final HttpServerRequest request) {
RequestUtils.bodyToJson(request, pathPrefix + "update", new Handler<JsonObject>() {
@Override
public void handle(JsonObject body) {
if (body.size() > 0) {
String name = body.getString("name");
Handler<Either<String, JsonObject>> handler = (name != null && !name.trim().isEmpty()) ?
updatePageHandler(request, name) : notEmptyResponseHandler(request);
communityService.update(request.params().get("id"), body, handler);
} else {
badRequest(request, "empty.json");
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:18,代码来源:CommunityController.java
示例3: delete
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Delete("/:id")
@SecuredAction(value = "", type = ActionType.RESOURCE)
public void delete(final HttpServerRequest request) {
communityService.delete(request.params().get("id"), new Handler<Either<String, JsonObject>>() {
@Override
public void handle(Either<String, JsonObject> r) {
if (r.isRight()) {
JsonObject deletePage = new JsonObject()
.putString("action", "delete")
.putString("pageId", r.right().getValue().getString("pageId"))
.putBoolean("deleteResources", true);
eb.send("communityPages", deletePage);
ok(request);
} else {
leftToResponse(request, r.left());
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:20,代码来源:CommunityController.java
示例4: listUsers
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Get("/:id/users")
@SecuredAction(value = "", type = ActionType.RESOURCE)
public void listUsers(final HttpServerRequest request) {
List<String> t = request.params().getAll("type");
JsonArray types = (t != null && !t.isEmpty()) ?
new JsonArray(t.toArray()) : resourcesTypes; //new JsonArray(RightsController.allowedSharingRights.toArray());
communityService.listUsers(request.params().get("id"), types, new Handler<Either<String, JsonObject>>() {
@Override
public void handle(final Either<String, JsonObject> event) {
final Handler<Either<String, JsonObject>> handler = defaultResponseHandler(request);
if (event.isRight()) {
final JsonObject res = event.right().getValue();
listVisible(request, I18n.acceptLanguage(request), new Handler<JsonObject>() {
@Override
public void handle(final JsonObject visibles) {
res.putObject("visibles", visibles);
handler.handle(event);
}
});
} else {
handler.handle(event);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:26,代码来源:CommunityController.java
示例5: listResourceTypes
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Get("/types")
@ApiDoc("List resource types")
@SecuredAction("rbs.type.list")
public void listResourceTypes(final HttpServerRequest request){
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
final List<String> groupsAndUserIds = new ArrayList<>();
groupsAndUserIds.add(user.getUserId());
if (user.getGroupsIds() != null) {
groupsAndUserIds.addAll(user.getGroupsIds());
}
resourceTypeService.list(groupsAndUserIds, user, arrayResponseHandler(request));
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:18,代码来源:ResourceTypeController.java
示例6: createResourceType
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Post("/type")
@ApiDoc("Create resource type")
@SecuredAction("rbs.type.create")
public void createResourceType(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
RequestUtils.bodyToJson(request, pathPrefix + "createResourceType", new Handler<JsonObject>() {
@Override
public void handle(JsonObject object) {
crudService.create(object, user, notEmptyResponseHandler(request));
}
});
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:22,代码来源:ResourceTypeController.java
示例7: updateResourceType
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Put("/type/:id")
@ApiDoc("Update resource type")
@SecuredAction(value = "rbs.manager", type = ActionType.RESOURCE)
public void updateResourceType(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
RequestUtils.bodyToJson(request, pathPrefix + "updateResourceType", new Handler<JsonObject>() {
@Override
public void handle(JsonObject object) {
String id = request.params().get("id");
crudService.update(id, object, user, defaultResponseHandler(request));
}
});
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:23,代码来源:ResourceTypeController.java
示例8: deleteResourceType
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Delete("/type/:id")
@ApiDoc("Delete resource type")
@SecuredAction(value = "rbs.manager", type = ActionType.RESOURCE)
public void deleteResourceType(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
String id = request.params().get("id");
crudService.delete(id, user, defaultResponseHandler(request, 204));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:18,代码来源:ResourceTypeController.java
示例9: createBooking
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Post("/resource/:id/booking")
@ApiDoc("Create booking of a given resource")
@SecuredAction(value = "rbs.contrib", type= ActionType.RESOURCE)
@ResourceFilter(TypeAndResourceAppendPolicy.class)
public void createBooking(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
RequestUtils.bodyToJson(request, pathPrefix + "createBooking",
getBookingHandler(user, request, true));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:20,代码来源:BookingController.java
示例10: createPeriodicBooking
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Post("/resource/:id/booking/periodic")
@ApiDoc("Create periodic booking of a given resource")
@SecuredAction(value = "rbs.contrib", type= ActionType.RESOURCE)
@ResourceFilter(TypeAndResourceAppendPolicy.class)
public void createPeriodicBooking(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
RequestUtils.bodyToJson(request, pathPrefix + "createPeriodicBooking",
getPeriodicBookingHandler(user, request, true));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:19,代码来源:BookingController.java
示例11: updateBooking
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Put("/resource/:id/booking/:bookingId")
@ApiDoc("Update booking")
@SecuredAction(value = "rbs.contrib", type= ActionType.RESOURCE)
@ResourceFilter(TypeAndResourceAppendPolicy.class)
public void updateBooking(final HttpServerRequest request){
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
RequestUtils.bodyToJson(request, pathPrefix + "updateBooking",
getBookingHandler(user, request, false));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:19,代码来源:BookingController.java
示例12: updatePeriodicBooking
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Put("/resource/:id/booking/:bookingId/periodic")
@ApiDoc("Update periodic booking")
@SecuredAction(value = "rbs.contrib", type= ActionType.RESOURCE)
@ResourceFilter(TypeAndResourceAppendPolicy.class)
public void updatePeriodicBooking(final HttpServerRequest request){
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
RequestUtils.bodyToJson(request, pathPrefix + "updatePeriodicBooking",
getPeriodicBookingHandler(user, request, false));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:19,代码来源:BookingController.java
示例13: listAllBookings
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Get("/bookings/all")
@ApiDoc("List all bookings")
@SecuredAction("rbs.booking.list.all")
public void listAllBookings(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
final List<String> groupsAndUserIds = new ArrayList<>();
groupsAndUserIds.add(user.getUserId());
if (user.getGroupsIds() != null) {
groupsAndUserIds.addAll(user.getGroupsIds());
}
bookingService.listAllBookings(user, groupsAndUserIds, arrayResponseHandler(request));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:22,代码来源:BookingController.java
示例14: getBooking
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@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,代码行数:26,代码来源:BookingController.java
示例15: listUserBookings
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Get("/bookings")
@ApiDoc("List all bookings created by current user")
@SecuredAction("rbs.booking.list")
public void listUserBookings(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
bookingService.listUserBookings(user, arrayResponseHandler(request));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:17,代码来源:BookingController.java
示例16: listBookingsByResource
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Get("/resource/:id/bookings")
@ApiDoc("List all bookings for a given resource")
@SecuredAction(value = "rbs.read", type = ActionType.RESOURCE)
@ResourceFilter(TypeAndResourceAppendPolicy.class)
public void listBookingsByResource(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
String resourceId = request.params().get("id");
bookingService.listBookingsByResource(resourceId, arrayResponseHandler(request));
} else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:19,代码来源:BookingController.java
示例17: listUnprocessedBookings
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Get("/bookings/unprocessed")
@ApiDoc("List all bookings waiting to be processed by current user")
@SecuredAction("rbs.booking.list.unprocessed")
public void listUnprocessedBookings(final HttpServerRequest request){
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
final List<String> groupsAndUserIds = new ArrayList<>();
groupsAndUserIds.add(user.getUserId());
if (user.getGroupsIds() != null) {
groupsAndUserIds.addAll(user.getGroupsIds());
}
bookingService.listUnprocessedBookings(groupsAndUserIds, user, arrayResponseHandler(request));
}
else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:26,代码来源:BookingController.java
示例18: list
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Override
@Get("/resources")
@ApiDoc("List all resources visible by current user")
@SecuredAction("rbs.resource.list")
public void list(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
final List<String> groupsAndUserIds = new ArrayList<>();
groupsAndUserIds.add(user.getUserId());
if (user.getGroupsIds() != null) {
groupsAndUserIds.addAll(user.getGroupsIds());
}
resourceService.listResources(groupsAndUserIds, user, arrayResponseHandler(request));
}
else {
log.debug("User not found in session.");
unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:26,代码来源:ResourceController.java
示例19: delete
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Override
@Delete("/resource/:id")
@ApiDoc("Delete resource")
@ResourceFilter(TypeAndResourceAppendPolicy.class)
@SecuredAction(value = "rbs.manager", type = ActionType.RESOURCE)
public void delete(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
if (user != null) {
String id = request.params().get("id");
crudService.delete(id, user, defaultResponseHandler(request));
} else {
log.debug("User not found in session.");
Renders.unauthorized(request);
}
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:rbs,代码行数:20,代码来源:ResourceController.java
示例20: createThread
import fr.wseduc.security.SecuredAction; //导入依赖的package包/类
@Post("/thread")
@ApiDoc("Create a new Thread.")
@SecuredAction("actualites.create")
public void createThread(final HttpServerRequest request) {
UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
@Override
public void handle(final UserInfos user) {
RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_THREAD_CREATE, new Handler<JsonObject>() {
@Override
public void handle(JsonObject resource) {
crudService.create(resource, user, notEmptyResponseHandler(request));
}
});
}
});
}
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:17,代码来源:ThreadController.java
注:本文中的fr.wseduc.security.SecuredAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论