Storm nodes appear in the #drupal_install#/node page even when user has no permission to view them.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screenshot - Mozilla Firefox-1.png | 57.09 KB | catorghans |
Storm nodes appear in the #drupal_install#/node page even when user has no permission to view them.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screenshot - Mozilla Firefox-1.png | 57.09 KB | catorghans |
Comments
Comment #1
Roberto Gerola commentedI see.
The access hook isn't considered on this page.
Comment #2
Roberto Gerola commentedNot sure there is a clean way to prevent this.
At now I found this solution :
Comment #3
catorghans commentedDoesn't work with me.
The anonymous user has "access content" permission but no permission for any of the storm permission items.
But if I logout and watch the default front page (the same as #drupal_install#/node) I see all created storm nodes as a teaser.
Hans
Comment #4
Roberto Gerola commentedAnd, with this function in storm.module file ?
Comment #5
catorghans commentedYes!
stormorganization_nodeapi had no effect, not even for organization nodes, but storm_nodeapi does work for all de storm nodes.
Comment #6
Roberto Gerola commentedComment #7
catorghans commentedminor detail: the nodes are not shown, but are occupying some space, even a pager is shown.
Comment #8
Roberto Gerola commentedYes, but it's not possible to do something more.
It would be necessary to rewrite the Drupal routine that creates the /node page.
Comment #9
rmiddle commentedI haven't had a change to look at the code yet but my guess is if you remove bit for the front page the issue would go away.
thanks
Robert
Comment #10
catorghans commentedRoberto is right.
Off course you can uncheck "Promoted to front page" on the storm content types.
Comment #11
Roberto Gerola commentedComment #12
Roberto Gerola commentedI had to remove the nodeapi hook implementantion.
It caused problems with other modules.
I'll figure out a different solution.
Comment #13
Roberto Gerola commentedI figured out a way to fix this in the correct way and to work everywhere and also
in conjunction with others node access control systems.
It involves the use only of some sql code, in the hook db_rewrite_sql.
Here there is the idea :
select * from node n
where
(
case n.type
when 'stormproject' then (select if(spr.organization_nid=5 and n.uid=1,0,1) from stormproject spr where spr.vid=n.vid)
else
0
end
)=0
Comment #14
Roberto Gerola commentedImplemented for MySQL in the version 1.6.
Comment #15
catorghans commentedIt seems that this solution gives a problem when a view is displayed (5.x-1.11).
In a view the "#prefix#node" is called "node" and not "n".
It doesn't seem right that this db_rewrite_sql hook is used in a "view".
I get then the next warning:
Unknown table 'n' in where clause query: SELECT DISTINCT(node.nid), node.created AS node_created_created FROM ct_node node INNER JOIN ct_node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public'))) AND ((case n.type WHEN 'stormexpense' THEN 0 WHEN 'storminvoice' THEN 0 WHEN 'storminvoiceitem' THEN 0 WHEN 'stormknowledgebase' THEN 0 WHEN 'stormnote' THEN 0 WHEN 'stormorganization' THEN 0 WHEN 'stormperson' THEN 0 WHEN 'stormproject' THEN 0 WHEN 'stormtask' THEN 0 WHEN 'stormticket' THEN 0 WHEN 'stormtimetracking' THEN 0 else 1 end)=1)
...
Comment #16
Roberto Gerola commentedSo, the view is using "node" as primary table but is passing "n" as primary table to db_rewrite_sql api.
I'll take a look at node_access system to understand how it is able to correctly use the alias name.
Comment #17
Roberto Gerola commentedJust tried with frontpage standard view under D5.
It seems to me to work correctly.
Are you using some custom code ?
Comment #18
catorghans commentednope, a pretty standard view which displays all "blog" nodes as teasers in a "block" in the "content" area on the front page.
Comment #19
Roberto Gerola commentedI think I have figured out what was happening.
It should be fixed now in the latest storm.module file in cvs.
Can you test it ? Thanks.
Comment #20
Roberto Gerola commentedComment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.