Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » A couple of security questions...

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1501 Views
  • Louie
    Avatar
    Community Member
    9 Posts

    A couple of security questions... Link to this post

    Hey there! I'm quite new to silverstripe and is still trying to figure out my way around. anyway, i'm trying to have custom group forms (by making security groups in the cms) in which the members of each group can access certain web pages and its functions, but i'm having a bit trouble "separating" the groups from each other when i get into the templates. Put quite simply, for example, i want group A to do actions X and Y, but I want group B to do only action Y. Now, is there any way to make a simple if-else statement which returns true if a specific security group name is met:

    (i.e. <% if CurrentMember.SecurityGroup = 'thisname' %> //do this, or something like that)

    Second question, how can I add custom fields for the members in the security groups? Basically, i want to add another field called 'ranking points' aside from the firstname, surname, email, and password fields.

    I'm so sorry i'm just a newbie in PHP, i'm trying out many things to figure out how to solve my problems but it seems that i have found no luck.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: A couple of security questions... Link to this post

    In the 2.3 release, you can use Controller::$allowed_actions to assign permission codes to specific controller methods. These permission codes can be granted to specific groups in admin/security. I've documented this on http://doc.silverstripe.com/doku.php?id=security#limiting_url-access_to_controller_methods

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: A couple of security questions... Link to this post

    Second question, how can I add custom fields for the members in the security groups? Basically, i want to add another field called 'ranking points' aside from the firstname, surname, email, and password fields.

    Have a look at DataObject Decorators. These allow you to modify an DataObject with your own fields and logic.

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