Social Network with Concrete5

Permalink
My goal is to have a user register on a site then be given a single page they can edit. So far the only way I've found to do this is to create a user, add the user to a group, then give the group permissions on a page. This works fine but requires too much moderation.
Is this option available? If not would my general understanding of PHP be enough to tweak it?
The user block add-on has some of this, but doesn't have the edit-ability of a Concrete5 block. Which is what we are shooting for.

netclickMe
 
Tony replied on at Permalink Best Answer Reply
Tony
if you turn on advanced permissions by adding this line to /config/site.php:

define('PERMISSIONS_MODEL', 'advanced');

then you can do stuff like this to programmatically give users access to pages:

$permissionsConfig = new stdClass;
$permissionsConfig->user[0]['uID'] = $this->u->getUserID();
$permissionsConfig->user[0]['canRead'] = 1;
$permissionsConfig->user[0]['canWrite'] = false;
$permissionsConfig->user[0]['canApproveVersions'] = false;
$permissionsConfig->user[0]['canDelete'] = false;
$permissionsConfig->user[0]['canAdmin'] = false;             
$newPage->assignPermissionSet($permissionsConfig);
netclickMe replied on at Permalink Reply
netclickMe
Ok, great. That's clear enough. Now 2 questions:
1. where does this new rewritten permission code go?
2. Is there a document with all of the $permissionsConfig alterations that can be made to user[]
Thank you
senshidigital replied on at Permalink Reply
senshidigital
You could possibly do this through the profile pages?

I am setting up a client area on my site and have made this tutorial on how to do it:

http://www.concrete5.org/community/forums/usage/how-to-create-a-cli...

You might find this might be a solution. You can have an editable area on the page that only certain users can access.
adamjohnson replied on at Permalink Reply
adamjohnson
I second what netclickMe said.

On another note, maybe this could evolve into an add on. Seems like something logical now that Concrete5 has two blog add ons and the e-commerce add on.
gerardguckian replied on at Permalink Reply
IS it possible to do this on an area basis as I would like to lock the users out of deleting blocks in a side bar area ?
Mnkras replied on at Permalink Reply
Mnkras
first you need to get the page then get an area on the page,

you will have to set $area,

$area = $this->getCollectionObj(); //change this
$pxml->guests['canRead'] = false;
$pxml->registered['canRead'] = false;
$pxml->group[0]['gID'] = ADMIN_GROUP_ID;
$pxml->group[0]['canRead'] = true;
$pxml->group[0]['canWrite'] = true;
$pxml->group[0]['canApproveVersions'] = true;
$pxml->group[0]['canDelete'] = true;
$pxml->group[0]['canAdmin'] = true;
$pxml->user[0]['uID']=$this->getUID();
$pxml->user[0]['canRead'] = true;
$pxml->user[0]['canWrite'] = false; 
$pxml->user[0]['canAdmin'] = false; 
$area->assignPermissionSet($pxml);