Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-3.0
Component:
exposed filters
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2009 at 04:37 UTC
Updated:
18 Feb 2017 at 12:39 UTC
Jump to comment: Most recent
Comments
Comment #1
dawehnerI don't think there is a permission currently.
If this feature comes in, there has to be a update function, which enables it for both, anonymous and authenticated users, to be sure, that the default behavior does not change.
I think i would be to write a patch until tomorrow.
Comment #2
beautifulmindI think it does not make much sense.
You can set permissions on a views which covers every thing on that view.
Now say, if we have permissions on filters, how would you able to display the partial results?
You can create different views with different filters for different roles, which is easy and manageable.
Comment #3
dawehneri meant for the full exposed filters.
Just a hook_perm for exposed filters.
Comment #4
jameswoods commentedIs there a way to make exposed taxonomy filters respect Tac Lite? For example, if a user does not have permission to view a term, that term should not show up in an exposed filter select list.
Here's my scenario where I think that permissions on exposed filters make sense:
I've got an inventory system set up in Drupal. I have multiple inventory managers, each managing their own department. I use Taxonomy and Tac Lite to control which Terms can be seen/used by which managers. In the node edit and add screens this works wonderfully, as the Computing department sees only computers and scanners and whatnot, while the Media department sees projectors and microphones.
I've got views set up with exposed filters. The filters themselves work great, except that the managers can see ALL terms of each vocabulary, not just the ones they're supposed to see (e.g. Media sees computers, and Computing sees microphones).
I know in the exposed filter settings, I can use 'Limit list to selected items', which "works"...but it will be a bear to manage, because I'll have to update Tac Lite and all of the exposed filters when a new term comes into play.
-James
Comment #5
dawehnerThis is definitive not part of views, if it is not possible via hook_db_rewrite_sql tac lite should alter the views handler.
I had a very short look at the code:
It would be possible if this code used taxonomy_get_tree or db_rewrite_sql always.
Comment #6
jameswoods commentedSo...Tac Lite should alter the options that get put into the exposed filters, not Views asking Tac Lite which options the user has perms to?
Meaning that I should go ask at the Tac Lite project?
Oh, and thanks for such a quick reply. You're one more reason Drupal is awesome 8^)
-James
Comment #7
vannus commentedid consider this a bug...
if your not allowed to view a field, you shouldnt be able to filter by it. at the very least, you wouldnt have to design new views depending on permissions.
ive had a look, but cant find where i should make the change so ill have to leave this to someone else :(
Comment #8
dawehner@vannus
This should be a bug of cck, not views, i think.
Comment #9
dawehner#611728: Domain Taxonomy terms exposed in Views
The rest is theming / hook_form_alter or a bug of cck.
Comment #11
neerajskydiver commentedSpent lot of time trying to search for the solution.
This is how we got it working -
Comment #12
gejo commentedAnother workaround:
Then each role will see a diferent set of exposed filters in the same url.
EDIT: Sorry, this is what #2 suggested...
Comment #13
krishanchandra commentedThanks,
Your code help me in views filter.
global $user;
$x = user_load($user->uid);
foreach($x->tac_lite[5] as $key => $value) {
$arg .= $value . "+" ;
}
return substr($arg, 0, -1) ;
Comment #14
danisha commentedI dont know why the terms not assigned to the individual user is seen in the views filter for that term. The tac_lite module and the views module should have been merged to use this.. Not allowing the filters to control the access according to the tac_lite functionality makes the working of the views a bit difficult.
Can someone help?
Where to post this code buddy krishnchandra??
Comment #15
hockey2112 commentedThanks #12... it never occurred to me to simply duplicate the Page display with the same URL and different filters/role access. Worked great!
Comment #16
bib_boy commentedhmm...tried #12 but it won't let me set different roles in the permissions. I change to anonymous in one Page view and it changes to anonymous in the other Page view...machine names are different. Any ideas?