Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » remove "Delete" button in GridField edit form

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 659 Views
  • sajok
    Avatar
    Community Member
    82 Posts

    remove "Delete" button in GridField edit form Link to this post

    Hello everyone,

    I have a data object managed "product" in model Admin interface. I want to set the permission to delete data objects to administrators only. I have this function which removes the delete button from the grid for non administrators, but not on the gridfield edit form:

    function canDelete($member = null) {
    return Permission::check('DELETE_PRODUCTS');
    }

    I want the delete button to be removed from the edit form too. I don't know why the permission check works only on the gridfield list but not on the edit form..

    any help?

    Thanks

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: remove "Delete" button in GridField edit form Link to this post

    Are you running the latest 3.1 build? I believe this had been fixed.

  • sajok
    Avatar
    Community Member
    82 Posts

    Re: remove "Delete" button in GridField edit form Link to this post

    Hi Willr,

    I'm using the stable version 3.0.5. Should I update to 3.1 build?

    thanks

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: remove "Delete" button in GridField edit form Link to this post

    Try upgrade and see if that fixes the issue, try define a canEdit function as well. I believe the delete button checks for edit as well. If this isn't fixed in 3.1 raise an issue.

    659 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.