Home

Create a Permission Code

Ever wanted to add an extra permission code so that when you add permissions to a group you can create a custom option? Here's how it's done; Simply add this code to your Page_Controller class as well as adding "implements PermissionProvider" on the end of the class definition like so:

That will create two new permission codes: 'USER' and 'SUPERUSER', so you can then call permission::check('USER') anywhere in your code to see if the current user is in a group with USER permissions.

 

About the Author

Name: Aram Balakjian

Website: http://www.aabweb.co.uk

Aram is a web designer/developer running London based agency aab web. He has a strong passion for developing attractive, usable sites around the SilverStripe CMS.

Comments (1)

  • rgrgrgrg

    Posted by rgr, 08/12/2009 8:16am (8 months ago)

RSS feed for comments on this page RSS feed for all comments

Post your comment