Skip to content

Commit

Permalink
Merge pull request #17 from DrOctavius/main
Browse files Browse the repository at this point in the history
http middleware helper improvements
  • Loading branch information
DrOctavius authored Aug 19, 2022
2 parents ae81ad4 + f2e84e8 commit 7ebcacc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ func (a *AuthDetails) UserUUID() uuid.UUID {
return id
}

func (a *AuthDetails) GetFullName() string {
return a.UserDetails.GetFullName()
}

func (a *AuthDetails) GetRole() string {
return a.UserDetails.GetRole()
}

func (a *AuthDetails) GetUserType() string {
return a.UserDetails.GetUserType()
}

//-------------------------------------\\

func (a *AuthDetails) GetDeviceID() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ type UserDetails struct {
LastName string
Username string
IsActive bool
UserType string
// UserType -> admin, client etc...
UserType string
// Role -> SuperAdmin, Admin, SalesMan etc...
Role string

// Secondary
Phone1 string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package authentication

func (u *UserDetails) GetFullName() string {
return u.FirstName + " " + u.LastName
}

func (u *UserDetails) GetRole() string {
return u.Role
}

func (u *UserDetails) GetUserType() string {
return u.UserType
}

0 comments on commit 7ebcacc

Please sign in to comment.