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

Java UserUtils类代码示例

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

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



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

示例1: create

import org.entcore.common.user.UserUtils; //导入依赖的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: listResourceTypes

import org.entcore.common.user.UserUtils; //导入依赖的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


示例3: createResourceType

import org.entcore.common.user.UserUtils; //导入依赖的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


示例4: updateResourceType

import org.entcore.common.user.UserUtils; //导入依赖的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 org.entcore.common.user.UserUtils; //导入依赖的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 org.entcore.common.user.UserUtils; //导入依赖的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 org.entcore.common.user.UserUtils; //导入依赖的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 org.entcore.common.user.UserUtils; //导入依赖的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 org.entcore.common.user.UserUtils; //导入依赖的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: listAllBookings

import org.entcore.common.user.UserUtils; //导入依赖的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


示例11: getBooking

import org.entcore.common.user.UserUtils; //导入依赖的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


示例12: listUserBookings

import org.entcore.common.user.UserUtils; //导入依赖的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


示例13: listBookingsByResource

import org.entcore.common.user.UserUtils; //导入依赖的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


示例14: listUnprocessedBookings

import org.entcore.common.user.UserUtils; //导入依赖的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


示例15: list

import org.entcore.common.user.UserUtils; //导入依赖的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


示例16: delete

import org.entcore.common.user.UserUtils; //导入依赖的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


示例17: createThread

import org.entcore.common.user.UserUtils; //导入依赖的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


示例18: updateThread

import org.entcore.common.user.UserUtils; //导入依赖的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


示例19: createDraft

import org.entcore.common.user.UserUtils; //导入依赖的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


示例20: createPublished

import org.entcore.common.user.UserUtils; //导入依赖的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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java LoggingRegistry类代码示例发布时间:2022-05-23
下一篇:
Java EditableWSDLOperation类代码示例发布时间: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