Skip to content
Snippets Groups Projects
Unverified Commit 648aa5a1 authored by Réthelyi Bálint's avatar Réthelyi Bálint :no_mouth:
Browse files

Add 'IsPultosch' field to User struct and related functions

The User struct has been expanded to include a new field 'IsPultosch', to provide additional user behavioural options. The default value for 'IsPultosch' is 'false'. Adjusted related functions to accommodate this change. This field enhances the user information for the later implementation of personalized features.
parent 6b5d1500
No related branches found
No related tags found
1 merge request!25Add API endpoints and middleware for user and product manipulation
......@@ -16,6 +16,7 @@ type User struct {
LoginURL string
Products []*db.Product
IsAdmin bool
IsPultosch bool
Error string
}
......@@ -59,6 +60,15 @@ func GetUserInfoBySession(r *http.Request) (*User, error) {
admin = s.User.IsAdmin
}
pultosch := false
if admin {
pultosch = true
} else {
if s.User != nil {
pultosch = s.User.IsPultosch
}
}
ps, e := db.GetProducts()
if e != nil {
//TODO: error handling
......@@ -70,6 +80,7 @@ func GetUserInfoBySession(r *http.Request) (*User, error) {
LoginURL: auth.GetLoginURL(),
Products: ps,
IsAdmin: admin,
IsPultosch: pultosch,
}
return user, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment