It is redundant and was originally used just as a way to test the access control system. It should be replaced with ($table_name.uid = $account->uid). This will eliminate one row per activity in the access table. Big ++
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | activity_408904-7.patch | 5.21 KB | Scott Reynolds |
| #2 | use_uid.patch | 1.94 KB | Scott Reynolds |
Comments
Comment #1
sirkitree commentedMaybe you can illustrate this with a patch? I'm not really sure what you mean.
Comment #2
Scott Reynolds commentedsure heres the patch.
So it removes the use of a grant with module = 'activity' and value = $GLOBAL['user']->uid. Prevents that from being added to teh db and prevents the overhead on the where part on a joined table.
Faster and better practice. I put it in there like this originally so I could test it with multiple access controls. I am confident it passes that test now, so we should remove it.
Comment #3
Scott Reynolds commentedupdating title to better reflect what this means.
Comment #4
Scott Reynolds commentedhttp://drupal.org/cvs?commit=203170
Comment #6
Scott Reynolds commentedOk after discussing this: #693156: Use <none> to not print message I think this just needs to be rolled back. And that includes rolling back this change as you can guarantee that you will have access records then? #574218: If no activity access records written, message might not show I guess not as modules could alter away all access records. But in that case, why write the Activity to the database if no one can pull them out?
Comment #7
Scott Reynolds commentedOk I like this patch. Essentially, we make Activity module itself use its own API for Access control. So it provides the realm activity_actor => uid
It allows admins to say whether or not to record it, and it shows off the api. I want to get a variable_set/get pair for counting the modules that provide realms before this goes in. using that variable set and get we can determine when a admin adds a module, if the activity access table should be rebuilt.
Comment #8
Scott Reynolds commentedhmm heres the patch.
Comment #9
Scott Reynolds commentedCommitted that patch here: http://drupal.org/cvs?commit=318766 after committing: http://drupal.org/cvs?commit=318762
Comment #10
sirkitree commentedWow, this is a great idea, and simplifies things - ingenious++