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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

specific user can only access to certain files, images, forum etc.

Go to End



Community Member, 12 Posts

29 October 2013 at 2:01pm

Hey there,

Im quite new to website building.

currently, what we wish to achieve is that for each user, he or she can only access to specific content of the website with same presentation. According to username, one user can his/her image, files, forum etc. and the rest documents for other users are hidden.
also everything needs to be done under one domain.

can someone tell me how i need to structure it? I have done a bit research regarding MCV. I have drafted unfinished code as following, (newpage.php in mysite/code)

class NewPage extends Page {

class NewPage_Controller extends Page_Controller {

static $allowed_actions = array(

public function NewPage(){

$data['Member'] = $this->login_model->get_member();
$this->load->view('Page', $data);

if ($member = Member::currentUser())

$sqlQuery = new SQLQuery();

$sqlQuery= "SELECT GroupID from Group_Members where MemberID='.$member->ID'"

$rawSQL = $sqlQuery->sql();
$result = $sqlQuery->execute();
$groupid = $result->first();

else {


thanks for your help in advance.