Blog Access Permissions: Posts in group blogs

Hi All - I've got a question about the Elgg blog that I'd appreciate a view on from those much more experienced than me!

At the moment, if you have a group blog, you go into the group and select the option to create a blog post. At that stage your selected group is passed into the blog plugin, and populates the 'Access' drop down. Then you do your blogging thing.

I've been asked by my users (staff using Elgg for teaching in a higher education context) whether it's possible to change the workflow here e.g. instead of going into a group and selecting the blog post option, go straight to the blog, and then choose the relevant group from the Access drop-down.

This seems to me to be quite a significant change to the functionality of the blog plugin. I'd effectively need to create our own local version of the blog plugin and modify it to do lookup user group memberships as part of creating the access control options. A very quick look suggests the right sort of hooks might be there for this, but I've always got concerns about the long term sustainability of this sort of change - we'd need to maintain this plugin through all our future upgrades.

So before I invest loads of time in this, I'd really appreciate a quick sanity check from more experienced users. Somebody must have thought about this before. Is there a performance hit in here that means it's a bad idea? Is there some other fundamental stumbling block that means Elgg was architected the way it was?

Thanks in advance.

  • A very good question. Yes, it is in the architecture and it would be a really good idea to change this behaviour for all core and other plugins extend the acces_id field and if a group is selected that the blog or other post would move to that group.

    With current Elgg it would be a little bit of a quirk, since acces_id is not intended to move content to a different container (e.g. a group).

  • Yeah - I kind of got that - have been looking at the input/access view and if I understand it correctly, it relies on a single container (group) being passed in and then overriding the defaults. Flipping that around to make the array displayed by default a list of all groups would be quite a significant change. I could maybe over-ride this view in the blog tool but it seems like quite a significant change and it could be something of a rabbit hole.

  • I've done similar customizations a couple of times. Your goal is easy to achieve by overriding a couple of things through a custom plugin. The changes should also survive through future upgrades. There's no hit on performance.

    A couple of questions however:

    If user selects "Group A" as the access level, what will be the container of the blog?

    1. Should it become user's personal blog and only the visibility is set to the group?
    2. Or should the blog also be located inside the group?

    In the first case it's enough to add the groups to the access dropdown though the 'access:collections:write', 'all' hook.

    If you answered 2:

    1. Will the access level and the group always be the same?
    2. Or can there be blogs that are contained by a group but have access_id set e.g. to logged in users?

    If you answered 2, you will also have to override the blog creation form and replace the hidden container_guid field with a dropdown that allows you to choose the container. Then users can decide freely both access and the container.

    [Edit: fixed a couple of sentences that didn't make sense]

  • I managed to find the code I've used for the first part. Here you go: https://gist.github.com/juho-jaakkola/10976786

  • If you answered 2 to both, you will propably also have to add some features that prevent user from creating a blog inside group A but setting its visibility to group B (which obviously wouldn't make any sense).

  • Hi Juho - this is really useful - thank you!

    Thinking about the questions you posed:

    I'm not sure that I understand the difference between a post that is part of the users personal blog but visible to the group versus a blog post also located inside the group? What's the difference / impact of those two options?

    If it helps give context, the Elgg site is used to support teaching. Students write their own personal blogs, which they are graded on. They also contribute to group blogs, which they are also graded on.

    So if I make this change, I still need to be able to seperate out personal blog posts from group blog posts (I have a 'show me all the blog posts' plugin which handles this for the personal blog space at the moment).

    In terms of the second question, I think I'll need to check with my users. I suspect that in most cases group blogs are only available to group members, which should make things simpler.

  • I'm not sure that I understand the difference between a post that is part of the users personal blog but visible to the group versus a blog post also located inside the group?

    Own blogs can be found from: www.yoursite.com/blog/owner/ammienoot
    And group blogs from www.yoursite.com/blog/group/123/all

    So the container determines the location of the blog (user's own blog or a group blog).

    Then there is the access_id which determines who can see the blog (regardless of who or what is it's container).

  • Okay - I get it I think.

    What if I wanted the post to appear in both containers?

    e.g. I post something which I want to appear on my own blog to anyone who's in the group, but also in the group blog (maybe I am confusing groups as containers, and groups as membership lists?)

  • Elgg currently supports only one container for a piece of content.

    When talking about groups, you can either mean an entity that is used as a container for a piece of content OR a collection of users who are members of that particular entity (have a "member" relationship to it, but are not contained by it).

  • If I remember it correctly, group access were available in access pull down in elgg versions < 1.6. At that time the container of blog was the owner himself. - Juho's scenario 1

    You can just hook into the blog creation action and change the container ID based on the access_id. But you have to take care of one more thing - that blogs are enabled for that particular group.

    - Mahin Akbar