本文整理了Java中com.clusterra.iam.core.application.user.UserId
类的一些代码示例,展示了UserId
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UserId
类的具体详情如下:
包路径:com.clusterra.iam.core.application.user.UserId
类名称:UserId
暂无
代码示例来源:origin: com.clusterra/pmbok-document
public UserId getModifiedByUserId() {
return new UserId(modifiedByUserId);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
public TenantNotFoundException(UserId userId) {
super("tenant not found by " + userId.getId());
}
代码示例来源:origin: com.clusterra/clusterra-pmbok-document
public UserId getModifiedByUserId() {
return new UserId(modifiedByUserId);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
public WrongTenantException(TenantId tenantId, UserId userId) {
super("user id <" + userId.getId() + "> does not belong to tenant <" + tenantId.getId() + ">");
}
}
代码示例来源:origin: com.clusterra/clusterra-pmbok-document
public UserId getCreatedByUserId() {
return new UserId(createdByUserId);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public boolean canExecute(UserId userId, String actionName) {
Validate.notNull(userId);
Validate.notEmpty(actionName);
return authorizedMembershipRepository.isUserAssociatedWithAction(userId.getId(), actionName) != null;
}
代码示例来源:origin: com.clusterra/pmbok-document
public UserId getCreatedByUserId() {
return new UserId(createdByUserId);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public void deleteByUserId(UserId userId) {
Set<AuthorizedMembership> memberships = authorizedMembershipRepository.findByUserId(userId.getId());
for (AuthorizedMembership membership : memberships) {
authorizedMembershipRepository.delete(membership);
}
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
private void delete(User user) {
applicationEventPublisher.publishEvent(new UserDeletingEvent(this, new UserId(user.getId())));
userRepository.delete(user);
applicationEventPublisher.publishEvent(new UserDeletedEvent(this, new UserId(user.getId())));
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public Tenant findByUser(UserId userId) throws TenantNotFoundException {
Tenant tenant = tenantRepository.findByUserId(userId.getId());
if (tenant == null) {
throw new TenantNotFoundException(userId);
}
return tenant;
}
代码示例来源:origin: com.clusterra/clusterra-iam-rest
@RequestMapping(value = "/{id}/disable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> disable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.disable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Override
public String getCurrentAuditor() {
try {
return identityTracker.currentUser().getId();
} catch (NotAuthenticatedException e) {
logger.debug("current identity not set, but called for, message: {}", e.getLocalizedMessage());
return null;
}
}
}
代码示例来源:origin: com.clusterra/iam-rest
@RequestMapping(value = "/{id}/disable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> disable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.disable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public boolean canExecute(UserId userId, ActionDescriptor actionDescriptor) {
return authorizedMembershipRepository.isUserAssociatedWithAction(userId.getId(), actionDescriptor.getActionName()) != null;
}
代码示例来源:origin: com.clusterra/iam-rest
@RequestMapping(value = "/{id}/enable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> enable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.enable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public List<RoleDescriptor> findRolesByUser(UserId userId) {
List<Role> roles = authorizedMembershipRepository.findRolesByUserId(userId.getId());
List<RoleDescriptor> result = new ArrayList<>(roles.size());
for (Role role : roles) {
result.add(new RoleDescriptor(role.getId(), role.getName()));
}
return result;
}
代码示例来源:origin: com.clusterra/iam-rest
@RequestMapping(value = "/{id}/cancel-invitation", method = RequestMethod.PUT)
public ResponseEntity<UserResource> cancelInvitation(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.cancelInvitation(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
private User getUser(UserId userId) throws UserNotFoundException {
User user = userRepository.findOne(userId.getId());
if (user == null) {
throw new UserNotFoundException(userId);
}
return user;
}
代码示例来源:origin: com.clusterra/clusterra-iam-rest
@RequestMapping(value = "/{id}/enable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> enable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.enable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public List<RoleDescriptor> findRolesByGroupAndUser(GroupDescriptor groupDescriptor, UserId userId) {
List<Role> roles = authorizedMembershipRepository.findRolesByGroupIdAndUserId(groupDescriptor.getGroupId(), userId.getId());
List<RoleDescriptor> result = new ArrayList<>(roles.size());
for (Role role : roles) {
result.add(new RoleDescriptor(role.getId(), role.getName()));
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!