Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Access in actions


Reply


2 Posts   288 Views

Avatar
cachobong

Community Member, 9 Posts

3 May 2013 at 7:51pm

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.

Avatar
Willr

Forum Moderator, 5513 Posts

5 May 2013 at 4:28pm

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

}