Refactor authorized_groups and authorized_projects

* separate logic for ids for find to private methods (authorized_project_ids/authorized_group_ids)
* leverage private methods in tm_in_authorized_projects to avoid DB hit
Redundant `self` detected.