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

158 admin menu #219

Merged
merged 20 commits into from
Jan 27, 2025
Merged

158 admin menu #219

merged 20 commits into from
Jan 27, 2025

Conversation

macano
Copy link
Contributor

@macano macano commented Jan 20, 2025

Display user option available only for admin user

macano added 11 commits January 20, 2025 09:49
Finaaalllyy, list users again in a new branch
Admin flag to determine if the user has admin privileges.
check if user and admin on each end point
handle general response

Delete User
Finaaalllyy, list users again in a new branch
Admin flag to determine if the user has admin privileges.
@macano macano temporarily deployed to swarm-pullrequest January 20, 2025 21:51 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 20, 2025 21:51 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 20, 2025 21:55 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 18:40 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 18:40 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 18:54 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 18:54 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 18:57 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 19:00 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 19:00 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 21, 2025 19:03 — with GitHub Actions Inactive
@macano macano requested a review from Erikvv January 21, 2025 19:24
Copy link
Member

@Erikvv Erikvv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful change which takes a lot less code than I thought.

I'll push a fix for the uuid thing.

compose.yaml Outdated Show resolved Hide resolved
frontend/src/user/use-user.ts Outdated Show resolved Hide resolved
frontend/src/user/use-user.ts Outdated Show resolved Hide resolved
ztor/src/main/kotlin/com/zenmo/ztor/plugins/Databases.kt Outdated Show resolved Hide resolved
frontend/src/user/use-user.ts Outdated Show resolved Hide resolved
frontend/src/components/zero-header.tsx Show resolved Hide resolved
@Erikvv Erikvv temporarily deployed to swarm-pullrequest January 21, 2025 21:13 — with GitHub Actions Inactive
@Erikvv Erikvv temporarily deployed to swarm-pullrequest January 21, 2025 21:13 — with GitHub Actions Inactive
@Erikvv Erikvv temporarily deployed to swarm-pullrequest January 21, 2025 21:17 — with GitHub Actions Inactive
const [state, setState] = useState<UseUserReturn>({
isLoading: true,
isLoggedIn: undefined,
username: undefined,
isAdmin: false,
})

useOnce(async () => {
try {
const response = await fetch(import.meta.env.VITE_ZTOR_URL + "/user-info", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I log in with a Keycloak user who is not in the database, /user-info gives a 500 error with java.util.NoSuchElementException.

Probably it should just have isAdmin: false

Copy link
Member

@Erikvv Erikvv Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix this in UserRepository.isAdmin() instead of in the frontend.

@macano macano temporarily deployed to swarm-pullrequest January 22, 2025 15:38 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 22, 2025 15:38 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 22, 2025 15:42 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 24, 2025 19:33 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 24, 2025 19:33 — with GitHub Actions Inactive
@macano macano temporarily deployed to swarm-pullrequest January 24, 2025 19:36 — with GitHub Actions Inactive
@macano macano merged commit 9db23bf into main Jan 27, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants