elkarte/Elkarte — pull request #1144 by emanuele45 (2013-12-10 23:28:05+00:00)
Title: Fasttrack

This is a meh...

In a previous PR I removed the access checks from the mentions (so that even mentions in boards not accessible were shown with a standard message <= that reminds me I have to change it in that PR), well this is an attempt to restore them, but not only, it's also many other things... lol

1) mentions status can now have 3 ranges of values:
- from 0 to 3 <= normal values, with meanings already explained in the code,
- from 10 to 13 (i.e. normal + 10) these are values for disabled type of mentions (similar to members status)
- lower than 0 <= this is kind of special, specular to the previous two, it is used to identify mentions that are (for example) in boards not accessible to the user. <= @Spuds this is the funny tricks I was mentioning :innocent: If you prefer a new column I can live with that too, or maybe use 20+, I used negative because I love symmetry :sparkling_heart: .

2) Since we want to fix accesses "ASAP" I introduced "fasttrack", a special setting for scheduled tasks that increase the frequency of a certain task (once every minute) for a short period of time (no more than 10 runs in a row) so that (hopefully) in a matter of few minutes the accesses should be properly set.

3) I added a scheduled task that performs a) periodical audits on the users that have been mentioned in order to discover any situation where a member has access to a board, but doesn't have access to the corresponding mentions, and b) in case of "fasttrack" restores the accesses properly.

Now that I wrote it, I think that 3a should also check for the other way around (i.e. members that have access to things that should not), because this is currently check only at visualization time and if something is retrieved that doesn't have proper access the fasttrack is launched.

I have plans to modify the mentions controller to try to retrieve more elements directly if some are not accessible, I pushed this to get some feedback, then I'll do the rest.

OMG I wrote a lot... xD