It would be a wonderful (and in my case, necessary) feature to have a user's workspace display nodes that have been made editable through the simple access module (nodes that were not originally authored by the user, but where the user has been granted permissions to edit them). I have replaced the older "bug report" with this feature request, as this seems more appropriate (and I'm hoping someone will take up this issue and create a patch). I may be able to work on a patch, but not until well into the summer months (and I'm not much of a coder-- willing to try, but no time at the moment). If anyone can help with this functionality it would be greatly appreciated. Thanks in advanced.

CommentFileSizeAuthor
#6 workspace.module12.48 KBsigsby
#3 workspace.patch.txt3.35 KBsigsby

Comments

bomarmonk’s picture

Any takers on adding this functionality to Workspace? Please... with sugar on top.

bomarmonk’s picture

I can offer some small amount of $ to implement this change to the 4.7 version of workspace (small potatoes--say $20--, but I'm guessing this is a small revision for someone who knows their php). Patches?

sigsby’s picture

StatusFileSize
new3.35 KB

I have a hacked version of workspace working with simple access, though I'm not sure if I broke it for use with node_perm_byrole. I've attached my current patch, but it will probably need some cleanup and review.

Please feel free to give me feedback on the patch.

bomarmonk’s picture

Thanks for the patch. I am getting errors when I first enable the patched workspace module with nodeperm_role still enabled:

include_once() [function.include]: Failed opening './modules/workspace/workspace.module' for inclusion (include_path='.;C:/Program Files/xampp/htdocs/mysite/modules/civicrm/;C:/Program Files/xampp/htdocs/mysite/modules/civicrm/\packages;.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\mysite\includes\bootstrap.inc on line 487.

include_once(./modules/workspace/workspace.module) [function.include-once]: failed to open stream: Permission denied in C:\Program Files\xampp\htdocs\mysite\includes\bootstrap.inc on line 487.

I will test with simple access and see if the errors go away.

bomarmonk’s picture

Also, workspace vanishes after this patch (I'm patching the 4.7 version of workspace): the menu dissappears and the module isn't even listed under in the access control area... I am looking forward to this feature, but I can't get this working yet. Thanks for the effort!

sigsby’s picture

Title: Integration with simple_access » copy of my hacked module
StatusFileSize
new12.48 KB

I apologize, but things are extremely busy for me right now. It will be a while before I have a chance to clean up my changes and troubleshoot why my patch isn't working. In the mean time here is a full copy of the module I'm using. Versions I'm using:

Drupal = 4.7.2
Workspace = // $Id: workspace.module,v 1.21.2.7 2006/05/07 19:44:00 jvandyk Exp $
Simple Access = // $Id: simple_access.module,v 1.17.2.1 2006/02/26 21:04:02 jjeff Exp $

In this hacked version I've also added the permission "access own workspace" in the hook function workspace_perm() and modified the hook function workspace_menu() to allow only users with the new permission to view their workspace.

I'll be happy to answer any questions about the hacks in this file, I just don't have the time to spend on patching and testing this properly.

sigsby’s picture

Decided I should post a little more info on the things I've changed in the uploaded file (posted above).

I've added the permission "access own workspace" in the hook function workspace_perm(), along with changing the hook function workspace_menu() to use this new permission. This is not related to the simple_access integration.

The other changes are, I believe, all in the function workspace_list() and were done to accomplish the following:

1. modified the checks for an access module to check for nodeperm_role OR simple_access.

2. modified the query to eliminate the duplicate listings by using an sql 'GROUP BY n.nid' and then using 'SUM(na.grant_update) AS grant_update' and 'SUM(na.grant_delete) AS grant_delete'.

3. modified the listing to only show nodes for which the user has edit and/or delete permissions. I am not showing nodes for which the user has only view permissions.

4. modified the listing for comments. This was necessary for the production site I made these changes for and doesn't strictly relate to the simple access integration. I've also hacked my version of the comment module, so I'm not sure how the comment handling changes in the workspace module will affect a stock drupal install.

bomarmonk’s picture

I am testing this with simple access and Drupal 4.7. It looks like it is close to working (no more errors), but the workspace currently doesn't reflect nodes for which the user has been given "edit" permissions through simple access. The complexity for my site is that I need both taxonomy access and simple access to be working (and I'm using Robb Canefield's nodeaccess_multi module). Robb's module does allow both access modules to work well together (perhaps a bit heavy on resource consumption, but I don't have an extremely busy site). I'm wondering if this is why the changes to workspace aren't working?

bomarmonk’s picture

Version: 4.7.x-1.x-dev » 6.x-1.x-dev

Let's keep this feature request alive for the 6.x version of this module. I have put in a request for this functionality as a views filter, so maybe work should be done to make workspace a views compatible module as well? I know it's a rather simple module right now, but views have become so widely used, that expanding workspace this way would benefit many.

bomarmonk’s picture

Title: copy of my hacked module » Hook into Access API so Workspace respects Permissions from 3rd party access modules

Changing title to reflect the feature request more clearly.

bomarmonk’s picture

Also, taxonomy access and simple access should now work together in core for Drupal 5, so the node_access_multi module above is no longer an issue.

frank ralf’s picture

Version: 6.x-1.x-dev » 4.7.x-1.x-dev
Status: Active » Closed (fixed)

Hi bomarkmunk,

I'm changing this back to 4.7 as there is a patch provided for that version and closing this thread. Please open a new issue if problem persists with current release.

tia
Frank