Change access level ACCESS_LOGGED_IN to specific group

I want to move all content of an exist elgg instance that has access_id ACCESS_LOGGED_IN to a specific group, since a second type of users will be entering the site.

So I need to move the content first and then change the access_id

Does anyone has an sql script available for doing this ?

 

  • ElggBatch returns ElggEntities. When you update an ElggEntity, the core automatically triggers an "update" event. The core also has event handlers registered for this event by default. So when you e.g. change the access_id of an entity, the core event handlers automatically update the same access_id also for the metadata and the river items.

    So in fact you might get a lot of benefits by using ElggBatch instead of a direct SQL query.

  • I am convinced. I'll start working on a plugin where you can move content to a group, or from or between groups. If I have some working code I'll publish it on github.

  • http://community.elgg.org/plugins/1211419/0.5.3/containers

    I think this plugin is aiming at moving single entities instead of a whole bunch of entities. That's why I haven't mentioned it yet. I also don't know if the plugin updates the access_id of all annotations / river entries that are attached to the entity. But the plugins helps you at least a little bit in coming up with a solution that fits your ideas.

  • @iionly, thanks. I looked at the code and some parts are reusable, but it is aimed at users moving a specific item to a container. Limited to blog and bookmarks.

  • the containers plugin is not limited to blogs and bookmarks - it handles most entity types (only limited since i over-rode the edit forms for each object specifically, so i did not include ALL possible entities, only the major ones).
    i did not code any access_id changes in containers. i didn't notice any need for it.