-2

(My apologies for all those that voted the question down. I'm not trying to avoid researching. I've been actually trying to find a way for doing this for the past several hours. The only thing I'm trying to avoid is paying the Umbraco TV membership fee)

This is probably a dumb question:

I'm somewhat familiar with MVC, but really new to UMBRACO 7. I'm going through documentation on how to add restricted pages (pages accesible to some membership types) and I have to create a model. I've been searching through the whole UMBRACO settings and developer back office pages but couldn't find where to add the models. Neither was I able to find in VS where to add them (which would be even more convenient).

Can someone point me in the right direction or any documentation where I would be able to understand how Umbraco and MVC+VS work together and add models and custom code to an UMBRACO 7 website?

(I have the site running locally in VS2013 and DB in MSSQL Server 2014)

THANK YOU KINDLY!

dcaping
  • 129
  • 1
  • 1
  • 13
  • Can you confirm that you really want to restrict access by the Member Type? Member Types are used to define what sorts of data you would like to store on the member (like the document type of members). Member Groups are roles. Using "Public Access", you can restrict by Members or Member Groups. – bowserm May 12 '15 at 00:43
  • I might be using the terminology incorrectly. That is what I meant: to restrict access to, for instance paid members. That would be what you're saying right? – dcaping May 20 '15 at 20:31
  • Yep. That answers my question. Thanks. I was clarifying because Member Types means something in Umbraco. Member Types are the document types of Members. If all you want to do is restrict access to paid members, you don't need to create any Models. You just need to create a Member Group in the umbraco backoffice and write some code that assigns that group to members who pay. Then all you have to do is use the out of the box public access to restrict access to members that have that member group. – bowserm May 20 '15 at 20:50

2 Answers2

0

I would recommend you read up on Umbraco surface controllers. You can learn a bit about what it is and how it works here: http://our.umbraco.org/documentation/Reference/Mvc/surface-controllers

To answer your question, you put your models where you always put model classes in MVC: Pretty much where ever you like in the solution. However, it would be pretty good idea to put it in a folder & namespace called Models.

Scherling
  • 1,350
  • 2
  • 13
  • 23
0

When I want to restrict access to pages in my umbraco site, I usually find that I can use the default "Public Access" that umbraco has set up. Just right click on a node in the content tree, and you should be able to restrict access to either specific members or a specific member groups.

https://our.umbraco.org/wiki/reference/umbraco-client/context-menus/public-access

bowserm
  • 1,046
  • 10
  • 25
  • Were you intending to answer this question but got some tabs mixed up?? ;) http://stackoverflow.com/questions/30173241/umbraco-public-access-error-when-authenticated – pc-pdx May 12 '15 at 21:58