本文整理了Java中org.visallo.core.model.user.UserRepository.toJsonWithAuths()
方法的一些代码示例,展示了UserRepository.toJsonWithAuths()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UserRepository.toJsonWithAuths()
方法的具体详情如下:
包路径:org.visallo.core.model.user.UserRepository
类名称:UserRepository
方法名:toJsonWithAuths
暂无
代码示例来源:origin: org.visallo/visallo-core
public void pushUserAccessChange(User user) {
JSONObject json = new JSONObject();
json.put("type", "userAccessChange");
json.put("permissions", getPermissionsWithUserIds(user.getUserId()));
json.put("data", getUserRepository().toJsonWithAuths(user));
broadcastJson(json);
}
代码示例来源:origin: org.visallo/visallo-web-plugins-admin-user-property-auth
@Handle
public JSONObject handle(
@Required(name = "user-name") String userName,
@Required(name = "auth") String auth,
User authUser
) throws Exception {
User user = userRepository.findByUsername(userName);
if (user == null) {
throw new VisalloResourceNotFoundException("User " + userName + " not found");
}
if (!(authorizationRepository instanceof UpdatableAuthorizationRepository)) {
throw new VisalloAccessDeniedException("Authorization repository does not support updating", authUser, userName);
}
for (String authStr : auth.split(SEPARATOR)) {
((UpdatableAuthorizationRepository) authorizationRepository).addAuthorization(user, authStr, authUser);
}
return userRepository.toJsonWithAuths(user);
}
}
代码示例来源:origin: org.visallo/visallo-web-plugins-admin-user-property-privileges
@Handle
public JSONObject handle(
@Required(name = "user-name") String userName,
@Required(name = "privileges") String privilegesParameter,
User authUser
) throws Exception {
Set<String> privileges = Privilege.stringToPrivileges(privilegesParameter);
User user = userRepository.findByUsername(userName);
if (user == null) {
throw new VisalloResourceNotFoundException("Could not find user: " + userName);
}
privilegeRepository.setPrivileges(user, privileges, authUser);
return userRepository.toJsonWithAuths(user);
}
}
代码示例来源:origin: org.visallo/visallo-web-plugins-admin-user-property-auth
@Handle
public JSONObject handle(
@Required(name = "user-name") String userName,
@Required(name = "auth") String auth,
User authUser
) throws Exception {
User user = userRepository.findByUsername(userName);
if (user == null) {
throw new VisalloResourceNotFoundException("Could not find user: " + userName);
}
if (!(authorizationRepository instanceof UpdatableAuthorizationRepository)) {
throw new VisalloAccessDeniedException("Authorization repository does not support updating", authUser, userName);
}
((UpdatableAuthorizationRepository) authorizationRepository).removeAuthorization(user, auth, authUser);
return userRepository.toJsonWithAuths(user);
}
}
内容来源于网络,如有侵权,请联系作者删除!