We have a site that has locations.
Example:
mysite.com/atlanta
mysite.com/boston
mysite.com/denver
Each user can only edit their respective location/page(s). We want to grant them access only to their page set in google analytics....is this possible?
Example: user A = /atlanta/* and user B = /boston/*
We basically want to silo off where they only see their location pages and no one else's data.
Any assistance would be awesome.
Thanks!
You have to create 3 views and provide edit permissions only to a user at the view level.
The permissions are inherited, so if you give the edit permissions at the property level, the user will automatically have the same permissions at the view level (for all the views of the property).
Related
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)
}
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.
I have a set of records which 1 column called "Site" (I used CCK for this)
I want some user to access Site A data while others just access Site B
I enabled Profile module, add a custom field called Site, then for user 1, I set the value of that Site field to A, and for user 2, I set it to B
However, I don't know how to specify the Filters in Drupal Views to compare that "Site" field in CCK object with the "Site" field in the Profile of current logged in Users
Anyway to do this or any other equivalent way to restrict access to data based on custom fields in User Profile ?
Thanks
You might want to check out the content profile module: http://drupal.org/project/content_profile. It allows you to create a new content type to extend the user profile. With this, content profiles are essentially nodes and will give you more flexibility within views.
Also, I'm not sure I completely understand your problem. You state:
I want some user to access Site A data
while others just access Site B
This sounds like you need to set up different roles to assign users and use one of Drupal's access control modules like content access:
http://drupal.org/project/content_access
http://more.zites.net/content_access_for_drupal_6
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.
I am currently working on a website which lists the businesses as per either their location or the category to which it belongs. Check: http://frugalmillionaire.net/
Existing Functionality implemented (Views, CCK and Taxonomy):
On clicking the Primary Menu Links the Business Category are passed as an argument to the View. Hence the view displays the business listings of the specific category only. Also to implement the Find Local Coupons Block ; a filter of the same view is exposed in a block.
My client wants to give the user the option to set his/her location on the website . Once the user sets that location then upon clicking the links in the primary menu (Restaurant) should list only the restaurants which are of the location set. Similarly clicking on any of the primary menu links should display of the businesses of the location set only.
Potential ways to do it :
1)Set the value selected by the user in the exposed filter. How can this be done?
2) Using Cookies. Can I use the Drupal Cookie to somehow achieve this?
Kindly help me out .
Any help/pointers/relevant links would be deeply appreciated.
Thanks
I think you are asking three different things.
1. How do you get location information from the current user and store it?
If the user is setting and forgetting their location, make a Profile Field. The Location module might be of help. If the user just types in a location for temporary usage, save it to their session.
2. How do you theme a site based on the user's location?
hook_menu_alter() can be used to change what your primary links are doing based on user data.
3. How do you preload the business Views based on this location?
Invoke the View programmatically,
where location information (when
available) is inserted in place of
the exposed filters. Useful Views Documentation.
Set the relevant information in your
View with Arguments. Set the default
to the user's location. Because you are relying on a dynamic default, you never need to send a "real" argument to the view.