Closed (won't fix)
Project:
Path redirect
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2009 at 11:30 UTC
Updated:
22 Aug 2013 at 09:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
dave reidRight now there's no conditional matching besides the path for redirections, so there's no possible way to redirect by roles. For now I'm going to leave as postponed as it would require a significant addition to the schema as well as the interface. Also, I'm not sure how useful others would find this feature as well, since this is the first time it's been requested. I'd like to sit on this for a bit and see if it gathers more interest.
Also marked #449126: Redirect by role? as a duplicate of this issue.
Comment #2
Trunkhorn commentedI like the idea of this since a lot of the access modules don't attack the issue for some generalized pages that I'd like to protect, and this is the only module to my knowledge with the potential to attack it at the path level.
Are their any other modules that do this already?
Comment #3
dave reid@Trunkhorn: This wouldn't be an appropriate module for denying access to certain paths. I'll do a little research to see if I can find a better solution for you.
Comment #4
Trunkhorn commentedI agree with that completely and understand the intent of this module is to allow redirects in a standards-based way in respect to w3c, so I don't disagree with your decision not to mess with it for this module.
Unfortunately it's my only lead for path level access denial at the moment, so I would definitely appreciate hearing what you find.
Comment #5
SerenityNow commentedHi-
I just wanted to weigh in and say that redirection by role would be very useful to me also. I see that you have said it's beyond the scope of your module, but I'd appreciate any guidance you could give with regard to the best way to achieve this.
For what it's worth, I think there would probably be quite a bit of interest in redirection by role - the use case for this is that you would want to redirect anonymous/unregistered users to a signup/registration page if they try to access certain paths.
click on a link to download a file -> redirect to registration page 'download_reg.html'
click on a thumbnail of an image that links to fullsize version -> redirect to registration page 'image_reg.html'
click on post comment button -> redirect to registration page 'comment_reg.html'
click on article in certain category -> redirect to registration page 'category_reg.html'
You get the idea - are there othe rmodules that can accomplish this type of functionality?
Comment #6
neochief commentedHello, guys. Here's a patch for 6.x to do that. Please review and mark "RTBC" if it works for you. For me it does.
Comment #7
gsemko commentedWorks fine for me too
Comment #8
gregglesJust browsing the queue and saw this - it seems like the wrong solution in the wrong module to me. I suggest looking into true node access solutions.
Comment #9
dave reidAfter consideration, I agree with greggles. I doubt that very many existing module users would find this functionality useful. Probably the easiest way to accomplish this would to implement a custom_url_rewrite_inbound() in your site's settings.php:
If someone wants to put in a solution for a smaller module that allows this via extending path_redirect, go for it.
Comment #10
neochief commentedHey Dave. I'd love to write a small module on top of Path Redirect, but obviously, it's not possible, as Path Redirect doesn't provide necessary hooks (in _path_redirect_check()).
As a result, it should be separate module, which duplicates administration interfaces of Path Redirect. But why we need to make a clone with only difference in conditions functionality? From my point of view, it worth to be in module. At least, we can thing about hooks in _path_redirect_check().
Comment #11
Trunkhorn commentedThis is the only solution to attack this at a path level, and needs to be taken seriously. Arguments such as "I don't know that many will find it useful" are really over-assuming.
Comment #12
boftx commentedI have a situation where I need to display a single menu item, but send a user to different pages based on roles. This would seem to be the right module to use if it had the capability.
Comment #13
josjreyes commentedI really like the idea pitched by #5, especially the: click on a link to download a file -> redirect to registration page 'download_reg.html' .
Instead of the registration page, I'd like to see it redirect to the user login page. I've seen this functionality is widely employed by peer-reviewed journal websites. Personally, I would find this very useful.
Comment #14
bmango commentedI know that this thread is a little bit old now, but I had a similar need to redirect pages based on the user role. I didn't want anonymous users to access certain pages. In particular some views, which because of the content access permissions, were coming up blank, and I wanted to redirect them to the registration page. I found I could just put in a few lines of code at the top of my template file and this solved the problem. The code I used was:
There may be other ways to achieve the same thing, but this worked the best for me.
I also posted a solution for redirecting/preventing user downloads (#13 and mentioned in #5) at Filefield Download Permission.
Comment #15
marktheshark commentedMy $0.02:
In most of my sites nodes are used for storing data, but views with fields are used for the actual presentation.
Search results may return nodes matching the search criteria, thus I would want to redirect the node link to e.g. a view.
However I don't want the redirect to also occur for user 1.
Any way to support this without enhancing this module to be role-aware?
Thank you
Comment #16
Seijun commentedI realize this thread is old, but I was wondering if the code in #14 would work with D7, and if it would be possible to implement using blocks?
Comment #17
kenorb commentedSee also:
http://drupal.stackexchange.com/questions/1790/redirect-users-after-logi...