Added '<% if HasPerm(PERM_CODE() %>' to ViewableData for template

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41094 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2007-08-31 00:27:34 +00:00
parent c0660c147b
commit 8ecb8f0d6a

View File

@ -681,6 +681,15 @@ class ViewableData extends Object implements Iterator {
function CurrentMember() {
return Member::currentUser();
}
/**
* Checks if the current user has the given permission.
* Can be used to implement security-specific sections within templates
* @return int The Permission record-ID if the permission can be found, null otherwise
*/
function HasPerm($permCode) {
return Permission::check($permCode);
}
/**
* Add some arbitrary data to this viewabledata object. Returns a new object with the