Skip to content

Commit

Permalink
Merge pull request #20 from vshn/access-attendance
Browse files Browse the repository at this point in the history
Remove check for attendance access for other users
  • Loading branch information
ccremer authored Nov 10, 2021
2 parents d4788f4 + 98b8936 commit 2667ba7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions pkg/odoo/employee.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
type Employee struct {
ID int `json:"id"`
Name string `json:"name"`
// AttendanceAccess returns true if the requesting user id has access to read attendances of this employee.
AttendanceAccess bool `json:"attendance_access"`
}

// SearchEmployee searches for an Employee with the given searchString in the Employee.Name.
Expand Down Expand Up @@ -53,7 +51,7 @@ func (c *Client) FetchEmployee(sid string, userId int) (*Employee, error) {
body, err := NewJsonRpcRequest(&ReadModelRequest{
Model: "hr.employee",
Domain: []Filter{[]interface{}{"user_id", "=", userId}},
Fields: []string{"name", "attendance_access"},
Fields: []string{"name"},
Limit: 0,
Offset: 0,
}).Encode()
Expand Down
4 changes: 0 additions & 4 deletions pkg/web/attendance_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ func (s Server) OvertimeReport() http.Handler {
view.ShowError(w, fmt.Errorf("no user matching '%s' found", searchUser))
return
}
if !e.AttendanceAccess {
view.ShowError(w, fmt.Errorf("you don't have access to read attendances of '%s'", e.Name))
return
}
employee = e
} else {
e, err := s.odoo.FetchEmployee(session.ID, session.UID)
Expand Down

0 comments on commit 2667ba7

Please sign in to comment.