• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ActionType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: update

import fr.wseduc.security.ActionType; //导入依赖的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


示例2: delete

import fr.wseduc.security.ActionType; //导入依赖的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


示例3: listUsers

import fr.wseduc.security.ActionType; //导入依赖的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


示例4: updateResourceType

import fr.wseduc.security.ActionType; //导入依赖的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


示例5: deleteResourceType

import fr.wseduc.security.ActionType; //导入依赖的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


示例6: createBooking

import fr.wseduc.security.ActionType; //导入依赖的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


示例7: createPeriodicBooking

import fr.wseduc.security.ActionType; //导入依赖的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


示例8: updateBooking

import fr.wseduc.security.ActionType; //导入依赖的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


示例9: updatePeriodicBooking

import fr.wseduc.security.ActionType; //导入依赖的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


示例10: getBooking

import fr.wseduc.security.ActionType; //导入依赖的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


示例11: listBookingsByResource

import fr.wseduc.security.ActionType; //导入依赖的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


示例12: delete

import fr.wseduc.security.ActionType; //导入依赖的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


示例13: updateThread

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Put("/thread/:" + Actualites.THREAD_RESOURCE_ID)
@ApiDoc("Update thread by id.")
@ResourceFilter(ThreadFilter.class)
@SecuredAction(value = "thread.manager", type = ActionType.RESOURCE)
public void updateThread(final HttpServerRequest request) {
	final String threadId = request.params().get(Actualites.THREAD_RESOURCE_ID);
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
			RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_THREAD_UPDATE, new Handler<JsonObject>() {
				@Override
				public void handle(JsonObject resource) {
					crudService.update(threadId, resource, user, notEmptyResponseHandler(request));
				}
			});
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:19,代码来源:ThreadController.java


示例14: createDraft

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Post("/thread/:"+Actualites.THREAD_RESOURCE_ID+"/info")
@ApiDoc("Add a new Info with draft status")
@ResourceFilter(ThreadFilter.class)
@SecuredAction(value = "thread.contrib", type = ActionType.RESOURCE)
public void createDraft(final HttpServerRequest request) {
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
			RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_INFO_CREATE, new Handler<JsonObject>() {
				@Override
				public void handle(JsonObject resource) {
					resource.putNumber("status", status_list.get(1));
					infoService.create(resource, user, Events.DRAFT.toString(),notEmptyResponseHandler(request));
				}
			});
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:19,代码来源:InfoController.java


示例15: createPublished

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Post("/thread/:"+Actualites.THREAD_RESOURCE_ID+"/info/published")
@ApiDoc("Add a new Info published status")
@ResourceFilter(ThreadFilter.class)
@SecuredAction(value = "thread.publish", type = ActionType.RESOURCE)
public void createPublished(final HttpServerRequest request) {
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
			RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_INFO_CREATE, new Handler<JsonObject>() {
				@Override
				public void handle(JsonObject resource) {
					resource.putNumber("status", status_list.get(3));
					infoService.create(resource, user, Events.CREATE_AND_PUBLISH.toString(),notEmptyResponseHandler(request));
				}
			});
		}
	});
}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:19,代码来源:InfoController.java


示例16: updateDraft

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Put("/thread/:"+Actualites.THREAD_RESOURCE_ID+"/info/:"+Actualites.INFO_RESOURCE_ID+"/draft")
@ApiDoc("Update : update an Info in Draft state in thread by thread and by id")
@ResourceFilter(InfoFilter.class)
@SecuredAction(value = "thread.contrib", type = ActionType.RESOURCE)
public void updateDraft(final HttpServerRequest request) {
    final String infoId = request.params().get(Actualites.INFO_RESOURCE_ID);
    UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
        @Override
        public void handle(final UserInfos user) {
            RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_INFO_UPDATE, new Handler<JsonObject>() {
                @Override
                public void handle(JsonObject resource) {
                    resource.putNumber("status", status_list.get(1));
                    if(!resource.containsField("expiration_date")){
                        resource.putString("expiration_date", null);
                    }
                    if(!resource.containsField("publication_date")){
                        resource.putString("publication_date", null);
                    }
                    notifyOwner(request, user, resource, infoId, NEWS_UPDATE_EVENT_TYPE);
                    infoService.update(infoId, resource, user, Events.UPDATE.toString(), notEmptyResponseHandler(request));
                }
            });
        }
    });
}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:27,代码来源:InfoController.java


示例17: updatePending

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Put("/thread/:"+Actualites.THREAD_RESOURCE_ID+"/info/:"+Actualites.INFO_RESOURCE_ID+"/pending")
@ApiDoc("Update : update an Info in Draft state in thread by thread and by id")
@ResourceFilter(InfoFilter.class)
@SecuredAction(value = "thread.publish", type = ActionType.RESOURCE)
public void updatePending(final HttpServerRequest request) {
    final String infoId = request.params().get(Actualites.INFO_RESOURCE_ID);
    UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
        @Override
        public void handle(final UserInfos user) {
            RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_INFO_UPDATE, new Handler<JsonObject>() {
                @Override
                public void handle(JsonObject resource) {
                    resource.putNumber("status", status_list.get(2));
                    if(!resource.containsField("expiration_date")){
                        resource.putString("expiration_date", null);
                    }
                    if(!resource.containsField("publication_date")){
                        resource.putString("publication_date", null);
                    }
                    notifyOwner(request, user, resource, infoId, NEWS_UPDATE_EVENT_TYPE);
                    infoService.update(infoId, resource, user, Events.PENDING.toString(), notEmptyResponseHandler(request));
                }
            });
        }
    });
}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:27,代码来源:InfoController.java


示例18: getInfoTimeline

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Get("/info/:"+ Actualites.INFO_RESOURCE_ID +"/timeline")
@ApiDoc("Get info timeline by id")
@ResourceFilter(InfoFilter.class)
@SecuredAction(value = "thread.publish", type = ActionType.RESOURCE)
public void getInfoTimeline (final HttpServerRequest request) {
    final String id = request.params().get(Actualites.INFO_RESOURCE_ID);
    if (id == null || id.trim().isEmpty()) {
        badRequest(request);
        return;
    }
    try {
        infoService.getRevisions(Long.parseLong(id), arrayResponseHandler(request));
    } catch (NumberFormatException e) {
        log.error("Error : id info must be a long object");
        badRequest(request);
    }
}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:18,代码来源:InfoController.java


示例19: updateComment

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@Put("/info/:"+Actualites.INFO_RESOURCE_ID+"/comment/:"+COMMENT_ID_PARAMETER)
@ApiDoc("Comment : modify a comment of an Info by info and comment id")
@ResourceFilter(InfoFilter.class)
@SecuredAction(value = "info.comment", type = ActionType.RESOURCE)
public void updateComment(final HttpServerRequest request) {
	final String commentId = request.params().get(COMMENT_ID_PARAMETER);
	UserUtils.getUserInfos(eb, request, new Handler<UserInfos>() {
		@Override
		public void handle(final UserInfos user) {
					RequestUtils.bodyToJson(request, pathPrefix + SCHEMA_COMMENT_UPDATE, new Handler<JsonObject>() {
						@Override
						public void handle(JsonObject resource) {
							crudService.update(commentId, resource, user, notEmptyResponseHandler(request));
						}
					});
				}
			});
		}
 
开发者ID:OPEN-ENT-NG,项目名称:actualites,代码行数:19,代码来源:CommentController.java


示例20: getUserInfos

import fr.wseduc.security.ActionType; //导入依赖的package包/类
@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,代码行数:21,代码来源:MaxicoursController.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QueryInterval类代码示例发布时间:2022-05-23
下一篇:
Java EventListener类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap