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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

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

Extending BlogHolder and BlogEntry


Go to End


2 Posts   2284 Views

Avatar
qlex

Community Member, 68 Posts

10 August 2009 at 11:40pm

Hi,
I have been extending blogholder and blogentry in order to allow customgroups edit only blogentires in CMS.

To do that, I have modified in /blog/code/BlogHolder.php:

class BlogHolder extends BlogTree

to
class BlogHolder extends BlogTree implements PermissionProvider

and added to the blogholder class:

function canCreate() {
		return Permission::check("CUSTOMGROUP");
		}
	function canDelete() {
		return Permission::check("CUSTOMGROUP");
		}
	function canEdit() {
		return Permission::check("CUSTOMGROUP");
	}

Now, I would like to make this change blog-module-upgrade save - meaning, move this to /mysite/code/

I already have there a BlogHolderDecorator which extends the Sitetree by adding some tabs to menu.

Could anyone suggest me how should i do that? I think I should create a new BlogHolder.php within /mysite/code/ but what should be in it ?

Thanx for a possibly quick reaction, as site for client is already up and I would like to protect the changes to BlogHolder before a future upgrade.

Qlex

Avatar
fanjade

Community Member, 1 Post

17 August 2009 at 2:55pm

来学习一下