Admin/Customer Roles (ASP.NET) - asp.net

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.

Related

Adding profile2 profile to panel in drupal7

I am building a social networking site with drupal 7.32.I am using Profile2 module for user profiles.I have added fields to the default profile type.Now, I want to display the profile on the right side of the two column stacked layout of the panel.After creating the panel pages and on the last screen where the layout appears when I click on the gear and add content the next screen asks for node id which I am not able to fill.What should be the node id ? I am in a fix.
Any and all help would be appreciated.
Are you using the Page manager? Add the "currently logged in user" to the context and you should get the ability to add personal information to the page.
Another way to go is to create a view with a contextual filter to the currently logged in user. The view can then later be displayed on the panels page (without context).

dynamically design asp.net webpage which can configured by admin users

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)
}

Searching users and showing user records in Plone

I want to implement search functionality in plone. Search depending on users , users email. Want to display user full details.
Is there any existing add on which I can use (or) I have to write my own code.
Plone does not do "users by content" by default.
User objects are not registered as content
Thus, the standard Plone search functionality does not cover users
If you wish to make users visible for everyone and searchable
There is add-on http://pypi.python.org/pypi/Products.remember/ which will turn users to content items and this serve some niche use cases
Alternatively, you can write your own search box view like Users/Group page in Site setup does
If you need members to be public on your site I would suggest take a look on Products.remember. It will also give you the ability to extend user records through Archetypes content subsystem and make them subject to workflow menu (have different states for members like disabled, registered, etc.)
http://collective-docs.readthedocs.org/en/latest/content/archetypes/index.html

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

Display different content for anonymous and logged in users

What I need to accomplish is this:
If an anonymous user visits the site, show regular site content.
If a user logs in to the site, then user-related content appears in place of the regular content.
I would like to accomplish this using the Views module.
I have looked at the Premium module, but it seems to be abandoned. I would like to avoid using the content-access module if at all possible, since I already have other access controls in place.
If you are creating a page display for the views, you can accomplish this with view's access controls. Views will show the first available display that the user has permissions to.
Create a display for the authenticated user view
Set the page path
Set the Access restrictions (eg., by Authenticated role)
Create a display for the anonymous user view
Set the page path to the same value
Optionally restrict access to the Anonymous role (not necessary, since if views can load the authenticated display for the user it will not bother with this one, but may keep it's use clear)
Since you cannot re-order the displays in a view (yet), you must define the views in the order of most restrictive to least restrictive.
For more complex displays, you can use the Panels Pages module to render the page differently based on a user's role.
If you only want to differentiate between anonymous and authenticated users, you can specify that different content blocks are visible to each role.
On my own site, I needed to differentiate between Administrators and everyone else, so I could not use the authenticated user role to define access for individual items. Similar to Views, with Panels Pages you can define multiple variants of pages that use the same path. Administrators have access to the first variant, and all other users fall through to using the second.
You could try using the CCK content permissions and set permissions on a per field basis. Then have different fields for different content that you want to publish. I believe this is included with the CCK module.

Resources