Download & Extend

Only allow certain roles to view cases/project info block

Project:Case Tracker
Version:6.x-1.0-beta8
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

I'm not sure if I've missed something, but I only want for display the class="project" block that gets added to my Project nodes to certain roles.

It's this block I mean:

Project number: xxxx
Opened by: admin
Opened on: Thursday, June 18, 2009 - 8:48pm
Last modified: Thursday, June 18, 2009 - 8:48pm
Operations: add Case | view all project cases

When a content type becomes a Casetracker Project type, no new options appear under CCK > content_permissions, nor in the Casetracker options . I had hoped that 'access casetracker' under permissions would prevent unauth users from seeing this project block if they didn't have the permission checked, but alas not. (or is this a bug?). It seems that this permission only blocks certain users from accessing the Views generated by casetracker, rather than the Casetracker block added to each node.

The only thing I can think of is some theming jiggery-pokery to create a tracker-project.tpl.php or an override to theme_casetracker_project_summary(), but would it not make a nice option for this module...?

Comments

#1

Check this issue and comment
and if solves your problem marks this as fixed
http://drupal.org/node/587762#comment-2081640

#2

It seems that this permission only blocks certain users from accessing the Views generated by casetracker, rather than the Casetracker block added to each node.

This is exactly correct.

I personally don't have much use for the extend functionality you're proposing, but if someone provides a reasonable patch to extend the "access case tracker" permission to hiding this information I'll certainly consider it.

#3

Version:6.x-1.0-beta3» 6.x-1.0-beta8

add this to line 220 casetracker.module

    }
+ if (user_access('access case tracker'))
      $node->content['casetracker_project_summary'] = array('#value' => theme('casetracker_project_summary', $node), '#weight' => -10);

#4

Status:active» needs review

#5

That looks like a solid approach to me. I can't imagine the use case to show the node and comments but not the bits of text that sum it up.

Case Tracker is not a CCK-based module, therefore nothing that describes as CCK will affect the core CT modules.

#6

I'm also interesting in this, so I can put a "Case Tracker" link into my menus that only shows up for certain roles. Right now I don't see a way to do this.

#7

@parasox Whether a link shows up or not relates to the permissions configured around that link. The permission for viewing the Case Tracker page is "access casetracker".

There might be a module related to the menu system that lets you place a link and add additional conditions around showing it. I don't think it relates to this issue.

Regarding the issue, I'm going to solidify my last comment--I think this should be full-on access control. I would like to see an alter hook to modify or add to the data that flows into the case/project summary. I've written multiple custom modules that had to override that just to add a piece of information, and once I had to override one of my own overrides and handle both customizations... gets messy.

The advantage of an alter hook like that would be the ability to check access and unset any bit of information you don't want to show, including all the information.

#8

Ah I see.. There is no "access casetracker" though, as per #922852: Permission: Access Case Tracker

I guess I'll have to use an older version of the module for now.

#9

If you need something like that, you can easily add it using hook_menu_alter() from a custom module at a higher weight than Views, or hook_views_default_views_alter() in a custom module to modify the View access settings.

nobody click here