Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admins can make comments on users #3266

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ServletAwareConfigurator extends ServerEndpointConfig.Configurator with La
null,
null,
null,
null,
null
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import javax.ws.rs.core.SecurityContext
override protected def newInstance = new GuestAuthFilter
}

val GUEST: User = new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR)
val GUEST: User = new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR, null)
}

@PreMatching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ object UserAuthenticator extends Authenticator[JwtContext, SessionUser] with Laz
val role =
UserRoleEnum.valueOf(context.getJwtClaims.getClaimValue("role").asInstanceOf[String])
val googleId = context.getJwtClaims.getClaimValue("googleId").asInstanceOf[String]
val user = new User(userId, userName, email, null, googleId, null, role)
val comment = context.getJwtClaims.getClaimValue("comment").asInstanceOf[String]
val user = new User(userId, userName, email, null, googleId, null, role, comment)
Optional.of(new SessionUser(user))
} catch {
case e: Exception =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class AdminUserResource {
updatedUser.setName(user.getName)
updatedUser.setEmail(user.getEmail)
updatedUser.setRole(user.getRole)
if (user.getComment != null) {
updatedUser.setComment(user.getComment)
}
userDao.update(updatedUser)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class WorkflowResourceSpec
user.setName("test_user")
user.setRole(UserRoleEnum.ADMIN)
user.setPassword("123")
user.setComment("test_comment")
user
}

Expand All @@ -47,6 +48,7 @@ class WorkflowResourceSpec
user.setName("test_user2")
user.setRole(UserRoleEnum.ADMIN)
user.setPassword("123")
user.setComment("test_comment2")
user
}

Expand Down
1 change: 1 addition & 0 deletions core/dao/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.10.6

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/gui/src/app/common/service/user/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class AuthService {
googleId: this.jwtHelperService.decodeToken(token).googleId,
googleAvatar: this.jwtHelperService.decodeToken(token).googleAvatar,
role: role,
comment: this.jwtHelperService.decodeToken(token).comment,
};
}

Expand Down
2 changes: 2 additions & 0 deletions core/gui/src/app/common/service/user/stub-user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { PublicInterfaceOf } from "../../util/stub";
export const MOCK_USER_ID = 1;
export const MOCK_USER_NAME = "testUser";
export const MOCK_USER_EMAIL = "[email protected]";
export const MOCK_USER_COMMENT = "testComent";
export const MOCK_USER = {
uid: MOCK_USER_ID,
name: MOCK_USER_NAME,
email: MOCK_USER_EMAIL,
googleId: undefined,
role: Role.REGULAR,
comment: MOCK_USER_COMMENT,
};

/**
Expand Down
1 change: 1 addition & 0 deletions core/gui/src/app/common/type/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface User
role: Role;
color?: string;
googleAvatar?: string;
comment: string;
}> {}

export interface File
Expand Down
Loading
Loading