optimizes querying for allowed users when no permission is provided
fixes nil reference when permission is not provided
speeds up projects#show by reducing loaded data
moves