Skip to content

Commit

Permalink
chore: undo get and list
Browse files Browse the repository at this point in the history
  • Loading branch information
davenewza committed Jan 7, 2024
1 parent e2fb75b commit 3ea1638
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
22 changes: 10 additions & 12 deletions runtime/actions/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ func Get(scope *Scope, input map[string]any) (map[string]any, error) {
return nil, err
}

if !canResolveEarly {
rowsToAuthorise := []map[string]any{}
if res != nil {
rowsToAuthorise = append(rowsToAuthorise, res)
}
rowsToAuthorise := []map[string]any{}
if res != nil {
rowsToAuthorise = append(rowsToAuthorise, res)
}

isAuthorised, err := AuthoriseAction(scope, input, rowsToAuthorise)
if err != nil {
return nil, err
}
isAuthorised, err := AuthoriseAction(scope, input, rowsToAuthorise)
if err != nil {
return nil, err
}

if !isAuthorised {
return nil, common.NewPermissionError()
}
if !isAuthorised {
return nil, common.NewPermissionError()
}

return res, err
Expand Down
14 changes: 6 additions & 8 deletions runtime/actions/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,13 @@ func List(scope *Scope, input map[string]any) (map[string]any, error) {
return nil, err
}

if !canResolveEarly {
isAuthorised, err := AuthoriseAction(scope, input, results)
if err != nil {
return nil, err
}
isAuthorised, err := AuthoriseAction(scope, input, results)
if err != nil {
return nil, err
}

if !isAuthorised {
return nil, common.NewPermissionError()
}
if !isAuthorised {
return nil, common.NewPermissionError()
}

return map[string]any{
Expand Down

0 comments on commit 3ea1638

Please sign in to comment.