I am attempting to create a classified site, whereby users can register to my site and then add a classified listing. I would like to use AccountController - my basic conundrum is when I add an advert I need it to be linked to a specific user.
E.G. User SSMith has created a new listing (View all listings by SSmith)
Is the built in AccountController capable of doing this? E.g. If I have a Listings table within my database how can I link the user account to that listing?
You need to make sure that the relevant actions on your Listings controller require a user to be authenticated so that you know who they are when they save a listing. Adding the [Authorize] attribute to the relevant actions is a simple place to start.
For a simple example look at this section of the Nerd Dinner tutorial http://nerddinnerbook.s3.amazonaws.com/Part9.htm.
Related
I made some changes to a DjangoCMS page. These changes are unpublished up to now.
I would like to show this unpublished page to someone who has no login to DjangoCMS.
Is there a way to create a public link to show the unpublished page to someone?
There are parameters/plugins you can set that may help, specifically admin_preview and render_plugin_block under CMSPluginBase. But for the most part, Django-cms doesn't allow you to perform that action.
What you can do is create a public user account, with a simple username and password you can give out. This public user account can have permission setup that ensures it has only view abilities, and you can restrict what pages it can see. Thus you can restrict the page just to the one you would like them to view, you can then give them access to it through the regular url.
Specifically, you'll want to look into CMS_PERMISSION and form there at Page-specific permissions and then at View restrictions and then at Page permissions.
http://docs.django-cms.org/en/latest/topics/permissions.html
Requirement: I have a requirement such that, when a new user is registered in my application, his details should be stored in Umbraco Membership. I am Currently able to add the member to the umbraco site and i can see the added members under the Member Folder in the Member Tab. But the problem is if I added a person named "Vineeth", his details can only be viewed when I follow the path below
Member Tab - Member Folder - Letter "v" Folder.
Similarly for each alphabets. Is there any way that I could see them all together. The reason I wanted to get the added members together is because my workflow is "The admin has to give approval for the registered users". So its not a good process for Admin to search under each alphabetic folder for the newly added members and approve them. So is there any way to list them together. I think one option there is adding the user control and populating the details in Grid View in that user-control and then display. Is there some other way that I could use for my requirement.
I checked with the way the search functionality is implemented in the Member section. But I am not sure how does this work. I identified the aspx page. but it has the code like below. So I am not sure what logic is written in the Search button functionality. Could you please advise me how can I do this. The path I found this is
..\umbraco\Members\MemberSearch.ascx
Also I would like to know how is the list populated in the Search page.
I want to design an asp.net webpage at run-time which are configured by admin user.
Means , Admin user will define metadata of a webpage (they will define the number and type of controls user will see based on different condition).
Once the page definitions are defined by admin users the normal users will see different view of a page based on their role.
Please suggest which is the best way to address this requirement. I am using Asp.net 2010.
Thanks in advance
There's not a lot of information to go on here. Do all users see the same page? Are there groups of users who see different items? Or are the pages fully customized for each user?
I would make a database of users and fields. For example, fields could be "CanAccessFoo" and "CanAccessBar", etc. Admins would have a page where they can edit users to change these. You could implement a group as well such as "View Only" that has certain properties and assign users to that group.
Then in your page (you don't even say if you're using MVC or web pages), you would dynamically show the controls based on your model which must contain the user.
#if (Model.User.CanAccessFoo) {
#Html.EditorFor(m => m.Foo)
}
I'm currently working on a website that is for a restaurant. I have created everything I need to but I'm confused on one part:
I have created two roles: Admin and Customer. I have a page that displays a menu.
My main problem is, how would I display this page to the customer as a simple menu page, and how would I display this page to the admin where he would be able to edit the items within the database?
Would I need to create two different pages, one for a standard customer and one for the admin, or could it be done through the sitemap, where a link (the edit menu page) is visible/invisible based on the user who is signed in? (How would I accomplish that?)
You can write your custom code for this, as you have yourself created two roles. you can use the following steps
1) Create form authentication ticket for your roles on login and add it so that you'll be able to authenticate user/roles and write authentication rules in web.config.
2) either create two different page for admin and customer or you can use single page that renders differently based on the role, if you creates a single page make sure you should hide secure admin menu items at server side itself so that it will not be rendered and thus no change can be made at client side for security reason or just add items based on roles dynamically always.
Let me know if you need more details.
In a standard, generated list view, how can I hide certain ActionLinks based on the roles the logged in user belongs to?
My friend wrote up this blog post about supporting multiple roles in security checks without "magic strings". (He discusses action links at the end.) I also have a comment there. I recommend putting the logic to determine permissions into your view model so that you don't clutter your view with permission checks.