The following applies to workspace.module,v 1.21.2.7 2006/05/07 19:44:00 jvandyk

At the moment, the display of the 'my workspace' link is controlled by line 27
$access = user_access('access content') && ($user->uid > 0);.

What this means is that if a user is logged in and has 'access content' rights but does not have any creation rights they will get a 'my workspace' link leading to an empty dropdown and a submit button which takes them to a
' you do not have permission etcetc' page.

It seems to me that the permissions should be set in the 'access control' page and should not be hardwired into the module.
The $access variable should take into account wether or not the user has any creation rights, irrespective of wether they are logged in or not.

I have attached a patch that IMO resolves this issue.

It creates an 'access workspace' in addition to the 'administer own workspace' permission in the access control page.
This new permission is then used to allow/deny access to the workspace with the following code:
$access = user_access('access content') && user_access('access workspace') && $createperm;
$createperm is TRUE if the user has any create permissions.

This gives the administrator better control over who gets to use the workspace module and prevents the link from appearing when it cannot be used anyway. The funtionality of 'administer own workspace' remains unchanged.

HTH

Comments

psycotic’s picture

I agree with the idea behind this patch, but I was wondering whether 'administer own workspace' should just be changed (incorporating your code), so that it is actually only 'access own workspace'. The reason being that there isn't much to 'administer' in your own workspace (just 2 items).

I've tried the patch though, and it worked fine for me. Good one.

kenorb’s picture

StatusFileSize
new934 bytes

Here are patches for 6.x: http://drupal.org/node/124912

hutch’s picture

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

I can confirm that this patch works as expected, Thanks!

frank ralf’s picture

Status: Needs review » Fixed

Suppose this is included in hutch's cumulative patch(es). Therefore setting this as fixed.

Frank

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.