Skip to content

Commit

Permalink
Merge pull request #145 from Viva-con-Agua/stage
Browse files Browse the repository at this point in the history
Stage
  • Loading branch information
deinelieblings authored Sep 8, 2023
2 parents 50768df + 854eaec commit c0ccb17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type (
DepositQuery struct {
ID []string `query:"id"`
Name string `query:"deposit_unit_name"`
Search string `query:"search"`
ReasonForPayment string `query:"reason_for_payment"`
CrewID []string `query:"crew_id"`
Status []string `query:"deposit_status"`
Expand Down Expand Up @@ -228,6 +229,7 @@ func (i *DepositUpdate) DepositDatabase(current *Deposit) (r *DepositUpdate, cre
func (i *DepositQuery) PermittedFilter(token *vcapool.AccessToken) bson.D {
filter := vmdb.NewFilter()
filter.EqualStringList("_id", i.ID)
filter.SearchString([]string{"deposit_units.taking.name", "reason_for_payment"}, i.Search)
if !token.Roles.Validate("admin;employee") {
filter.EqualString("crew_id", token.CrewID)
} else {
Expand Down

0 comments on commit c0ccb17

Please sign in to comment.