Skip to content

Commit

Permalink
add reorder authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed May 30, 2024
1 parent b0e61ff commit 845a10a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/3.0/records-reordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,20 @@ self.ordering = {
}
}
```

## Authorization

If you're using the [authorization](./authorization) feature please ensure you give the proper permissions using the [`reorder?`](./authorization#reorder) method.

```ruby
class CourseLinkPolicy < ApplicationPolicy
def reorder? = edit?

# or a custom permission

def reorder?
user.can_reorder_items?
end

# other policy methods
end

0 comments on commit 845a10a

Please sign in to comment.