Add plugin hook to and improve get_access_sql_suffix()
|Reported by:||brettp||Owned by:|
get_access_sql_suffix() is the primary way to decide if entities are available to the user. This function is used (and abused) by metadata, annotations, and river functions. I've attached a patch that cleans up the SQL generated, allows you to customize the column names, and emits a plugin hook so plugins can add to or remove restraints. In addition to removing the horrible hacks using str_replace() for river and metadata functions, I believe this is enough to implement a decent roles plugin using only plugin hooks.