Sorry that I did follow through in http://drupal.org/node/380008#comment-2130300

But the problem still grant no access (view/edit) to the assigned team or project manager in neither Project, Task, nor Ticket.

I repeated my test in that comment and copied to here to save the jump:

Testing result of 04-02-20010 devel. version:

Testing senario A
A1. OrgA. with ProjA1 OrgB. with ProjB1
A2. UserA set n TeamA and only the person in OrgA
A3. ProjB1 set TeamA as Assign_to
A4. UserA's role permission include "Storm project: view if assigned to project"
ResultA: problems A is abbr. as PA#, hereafter.
PA1: UserA doest not have ProjB listed in storm/project
PA2: UserA cannot see and Task/Ticket under ProjB

Testing senario B
B1, B2 is the same as A1, A2
B3: ProjB1 set UserA as Project_manager
B4: UserA's role permission include "Storm project: view if assigned to project" and "Storm project: edit if project manager"
ResultB:
PB1: UserA have ProjB listed in Storm/Project but has not "Edit" icon for editing
PB2: UserA click on PorjB at Storm/Project liste, got "Access Denied"
PB3: UserA cannot see any Task/Ticket under ProjB

Testing senario C
C1: Same as A1
C2: UserA set n TeamA and added as person in OrgA AND person in OrgB (last added )
C3: ProjB1 set UserA as Project_manager
C4: UserA's role permission include "Storm project: view if assigned to project" and "Storm project: edit if project manager"
Result C:
PC1: UserA only see the lists belong to OrgB in Strom/Project, Task, Ticket
PC2: UserA click on any of the list item (project/ticket/task) get "Access denied"

It seems that Person belong to Org. only get the first entry. And the Team permsssion has not effect in project access.

Testing senario D
D1: Same as A1
D2: Same as C2
D3: ProjB1 set UserA as Assign_to
D4: UserA's role permission include "Storm project: view if assigned to project" and "Storm project: edit if project manager"
Result D:
Same as PC1 and PC2

It seems that the Assign_to Team and assigned_to Project Manager permissions have not effect.

Basically, that's the repeat of my last testing. I also check the code posted in http://drupal.org/node/380008#comment-2130300 and compared to this devel. version and the code are committed but with little variations but it is not working even I changed them to the same at the comment.

CommentFileSizeAuthor
#8 storm--762002-7.patch1.93 KBjuliangb
#6 storm--762002-6.patch996 bytesjuliangb

Comments

tazus’s picture

Hm.., am I the only one who have this problem?

Hopefully, anyone who has successful settings or running sites, please point a direction.

Thanks

tazus’s picture

Status: Active » Needs work

OK Guys,

It took me a while to put on coding cap ;0. But It looks I figure out the problem is:

Inside the "Stormtask.module" the function stormtask_access (line 50) there are to variables used $account->stormorganization_nid and $account->stormperson_ni but never been initiated.

So, what I did the verified the problem is adding next line in Stormtask.module line 55 right about "if (is_numeric($node)) {$node = node_load($node);}"
if (!$account->stormperson_nid) stormperson_init();

And I tested the result of assigned to Team or Person, the access works fine now.

I am not sure my code is a proper patch to the whole program structure. And I believe such patch will also needed in Project and Ticket module. So, maybe there is a better position to put this initial variables. So, if anyone can verified this problem and provide a better way to make a good patch, please follow-up.

Happy coding.

juliangb’s picture

Sounds like the real question is why stormperson_init is not being called. From my understanding, that should be called on every page request.

http://api.drupal.org/api/function/hook_init/6

twooten’s picture

juliangb,

From my understanding hook_init() is called on every page request unless caching is turned on. I went through the same issue while writing the visitorinfo module. I ended up using hook_boot() instead. http://api.drupal.org/api/function/hook_boot

I just installed storm last night, so far it really looks awesome and I think it's gonna do exactly what I need it to do. I spent 2 days trying to make Open Atrium into the project management app I need but no luck. I'll let you know how this works out for me.

Tim

juliangb’s picture

Status: Needs work » Needs review
StatusFileSize
new996 bytes

Try this patch.

tazus’s picture

This is my test of the patch:

applied to lastest dev version.

When access to stormtask, I got this error. Similar error to ticket, project, expense, annd timetracking. This only happened to the user is not admin (uid =1).

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR spr.assigned_nid=) AND ('storm_access'='storm_access') AND ( n.status=1 AND s' at line 2 query: SELECT DISTINCT n.nid, n.title FROM node AS n INNER JOIN stormproject AS spr ON spr.vid=n.vid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'workflow_access') OR (na.gid = 5 AND na.realm = 'workflow_access') OR (na.gid = 32 AND na.realm = 'workflow_access_owner') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 225 AND na.realm = 'og_subscriber'))) AND (n.language ='zh-hant' OR n.language ='' OR n.language IS NULL) AND ( (n.uid=32 OR spr.manager_nid= OR spr.assigned_nid=) AND ('storm_access'='storm_access') AND ( n.status=1 AND spr.organization_nid=0 AND n.type='stormproject' ) )ORDER BY n.title in sites/all/modules/storm/stormtask/stormtask.admin.inc on line 666.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ('storm_access'='storm_access') AND ( n.status=1 AND n.type='stormtask' ) ' at line 1 query: SELECT COUNT(*) FROM node AS n INNER JOIN stormtask AS sta ON n.vid=sta.vid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'workflow_access') OR (na.gid = 5 AND na.realm = 'workflow_access') OR (na.gid = 32 AND na.realm = 'workflow_access_owner') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 225 AND na.realm = 'og_subscriber'))) AND (n.language ='zh-hant' OR n.language ='' OR n.language IS NULL) AND ( (n.uid=32 OR sta.assigned_nid=) AND ('storm_access'='storm_access') AND ( n.status=1 AND n.type='stormtask' ) ) in sites/all/modules/storm/stormtask/stormtask.admin.inc on line 582.

juliangb’s picture

StatusFileSize
new1.93 KB

Updated patch.

Also - tazus, would you be able to confirm whether the clean dev version still shows the error with page caching turned off?

juliangb’s picture

*Bump* for review.

tchurch’s picture

+1

tazus’s picture

I will try to schedule a time to do the test in this week to report the status.

Tks.

juliangb’s picture

Bump for review. I don't want to commit this without a second eye.

juliangb’s picture

#8: storm--762002-7.patch queued for re-testing.

erle’s picture

I just stumbled across this error, applied your new patch, got this error when click on the project lists, will have a closer look and submit more info over coming days.

pasting the err below, if it helps

thanks for the bump, need to sort this one out myself too

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ('storm_access'='storm_access') AND ( n.status=1 AND n.type='stormorganiza' at line 1 query: SELECT DISTINCT n.nid, n.title FROM node AS n INNER JOIN stormorganization AS sor ON n.vid=sor.vid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'nodeaccess_rid') OR (na.gid = 3 AND na.realm = 'nodeaccess_rid') OR (na.gid = 4 AND na.realm = 'nodeaccess_uid') OR (na.gid = 4 AND na.realm = 'nodeaccess_author'))) AND ( (n.nid=) AND ('storm_access'='storm_access') AND ( n.status=1 AND n.type='stormorganization' ) )ORDER BY n.title in sites/all/modules/storm/stormproject/stormproject.admin.inc on line 241.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR spr.manager_nid= OR spr.assigned_nid=) AND ('storm_access'='storm_access') AN' at line 1 query: SELECT COUNT(*) FROM node AS n INNER JOIN stormproject AS spr ON n.vid=spr.vid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'nodeaccess_rid') OR (na.gid = 3 AND na.realm = 'nodeaccess_rid') OR (na.gid = 4 AND na.realm = 'nodeaccess_uid') OR (na.gid = 4 AND na.realm = 'nodeaccess_author'))) AND ( (n.uid=4 OR spr.organization_nid= OR spr.manager_nid= OR spr.assigned_nid=) AND ('storm_access'='storm_access') AND ( n.status=1 AND n.type='stormproject') ) in sites/all/modules/storm/stormproject/stormproject.admin.inc on line 179.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR spr.manager_nid= OR spr.assigned_nid=) AND ('storm_access'='storm_access') AN' at line 1 query: SELECT DISTINCT n.*, spr.* FROM node AS n INNER JOIN stormproject AS spr ON n.vid=spr.vid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'nodeaccess_rid') OR (na.gid = 3 AND na.realm = 'nodeaccess_rid') OR (na.gid = 4 AND na.realm = 'nodeaccess_uid') OR (na.gid = 4 AND na.realm = 'nodeaccess_author'))) AND ( (n.uid=4 OR spr.organization_nid= OR spr.manager_nid= OR spr.assigned_nid=) AND ('storm_access'='storm_access') AND ( n.status=1 AND n.type='stormproject') ) LIMIT 0, 10 in sites/all/modules/storm/stormproject/stormproject.admin.inc on line 179.
juliangb’s picture

Status: Needs review » Needs work

Sounds like CNW.

erle’s picture

just a follow up, i never managed to replicate this on fresh install. So the issue I've noted above, is a bit circumspect, possibly triggered by some strange configuration somewhere. Since i cannot replicate, i guess that negates my comments above. I did nothing, i just resetup a fresh instance, new core, fresh modules, and it just worked.

francewhoa’s picture

Deleting my duplicate post

francewhoa’s picture

We get a similar issue with Storm Person/People. It's maybe related? We wrote a scenario to reproduce at #1060514: Storm Person: Remove possibility to assign two persons to one user

driss’s picture

Hello Tarzus (#2) and all,

After update Storm last week, your good solution doesn't work since 6.x-1.36... :-( Now all customers no see the ticket I created with my account and don't see my tasks (assign or not the user, the problem is the same).

I hope the next version will purpose this fonctionnaly or solve the issue (because in the list of "users restriction", there's "allow see task/ticket assigned" and "see ticket of the organisation" : but the user see nothing if the ticket/task are not created with is account user.

Have a nice day everybody !

Driss

amitrana123’s picture

Status: Needs work » Needs review

#6: storm--762002-6.patch queued for re-testing.

kfritsche’s picture

The patch seems a little bit strange to me.
Don't understand why $user->stormorganization issn't set, this should be handled by the user_load function.
Some ideas, why this issn't in some scenarios the case?

Before i will commit this, i will re-check the behavior, i do not want to break some other stuff or slow down by calling this function on boot.

juliangb’s picture

I'd be hesitant about committing this.

The patch was produced a while ago and has not had revisions since it was set "needs work".

juliangb’s picture

#8: storm--762002-7.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, storm--762002-7.patch, failed testing.

kfritsche’s picture

Status: Needs work » Fixed

This all makes no sense to me.
I really do not want to add something like this to the hook_boot, if we do not need it.
I looked into it now a while and thought about it. Please correct me, if i'm wrong at any point!
Firstly if a page is cached in drupal, the page will be instantly outputed, so it shouldn't get to any storm module code, where this is needed. Normally only pages from anonymous users are cached, and they do not belong to any team or organization.
So there is no way stormperson_init wouldn't be called before the normal call of any storm function.

But then why, this problem occurs? I dig a little deeper into drupal and storm and can't find any solution, but i remembered i already searched for this some time ago. A quick look in the changelog and there it is: #1316098: Permissions Storm organization: view belonged doesn't work. WHEN Menu breadcrumb is enabled

I think this bug is fixed already in 1.x and 2.x. The patch from #1316098 exactly does what tazus proposed in comment #2 here. And so it is was an conflict with other modules, which called the storm_access functions to early.

Setting this to fixed. Please reopen it, if i'm wrong, with my assumption, that this is a duplicate of #1316098: Permissions Storm organization: view belonged doesn't work. WHEN Menu breadcrumb is enabled.

Status: Fixed » Closed (fixed)

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