mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Update GridFieldOrderableRows.php
If it's a many many relationship, then it should be based on View not edit, as the sort field will be on the relationship using many_many_extraFields. Plus the view permission allows the user to create a many relationship, so it should allow editing of the relationship.
This commit is contained in:
parent
45eb7954a6
commit
0e424821a8
@ -138,7 +138,9 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||||||
* Handles requests to reorder a set of IDs in a specific order.
|
* Handles requests to reorder a set of IDs in a specific order.
|
||||||
*/
|
*/
|
||||||
public function handleReorder($grid, $request) {
|
public function handleReorder($grid, $request) {
|
||||||
if(!singleton($grid->getModelClass())->canEdit()) {
|
if (is_a($grid->getList(), 'ManyManyList') && !singleton($grid->getModelClass())->canView()) {
|
||||||
|
$this->httpError(403);
|
||||||
|
} else if(!is_a($grid->getList(), 'ManyManyList') && !singleton($grid->getModelClass())->canEdit()) {
|
||||||
$this->httpError(403);
|
$this->httpError(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user