Jump to:

23493 Posts in 19013 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » HasManyComplexTableField security question

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1830 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    HasManyComplexTableField security question Link to this post

    I have a page with a HasManyComplexTableField and a user that is a member of a group that has permission to edit that page. However that person only sees magnifying glasses instead of edit and delete icons for the items in the table. I don't want to make this user an admin so how do I set up the permissions on the page so that users that can edit Content can also edit the HasManyComplexTableField?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: HasManyComplexTableField security question Link to this post

    First of all, you'll want to assign a security group as the editor group of the page using the "Access" tab while viewing a page in the CMS. I'm assuming you've already done this.

    The table behaviour is probably to do with the Can() method on TableListField, which determines if the logged in user can add, edit or delete items.

    You can probably override this by calling setPermissions(array('add', 'edit', 'delete')) on your HasManyComplexTableField.

  • nafetsch
    Avatar
    Community Member
    15 Posts

    Re: HasManyComplexTableField security question Link to this post

    I have the same problem. why editors can´t edit datafields?

    i add

    $this->setPermissions(array('add', 'edit', 'delete'));

    to

    class HasManyComplexTableField extends ComplexTableField {

    But it makes no difference...

  • SilverDan
    Avatar
    Community Member
    5 Posts

    Re: HasManyComplexTableField security question Link to this post

    Was there ever a solution for this post?

    I have come across the same problem where non-admin group users can't edit, add or delete items in the relationship table (only view). Using the $field->setPermissions() method does override the actions permissions, and will show or hide the relevant edit/add/view/delete buttons, but won't actually affect the functions of those buttons. Ie. It won't override the permission to edit, for example, just decide whether to show or hide the button.

    So, is there another deeper level access to control the permissions for the HasManyComplexTableField items? I can't find anything usable in the documentation/API etc.

  • nafetsch
    Avatar
    Community Member
    15 Posts

    Re: HasManyComplexTableField security question Link to this post

    perhaps this is your solution:

    class XXX extends DataObject {

       ...
    ...

    function canDelete() {
    return true;
    }
    function canEdit() {
    return true;
    }

    }

    with that editors have rights.

    1830 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.