Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Access in actions

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

Page: 1
Go to End
Author Topic: 213 Views
  • cachobong
    Avatar
    Community Member
    9 Posts

    Access in actions Link to this post

    Is there any way that i can check which action was accessed? for example for Register action on a Sign Up Page, i can access this without having to login then if i just access the page without any action i am required to login.

    Example:
    mysite.com/upgrade-me <-- has to be logged in
    mysite.com/upgrade-me/Register <-- no need to be logged in.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Access in actions Link to this post

    You can require permissions in the $url_handlers helper or in your actions method.

    function youraction() {
    if (!Member::currentUser()) {
    return Security::permissionFailure();
    }

    // rest of youraction ..

    }

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