Skip to content

Commit

Permalink
[api] Fix forbidden_projects_ids query
Browse files Browse the repository at this point in the history
The project access flag has two status: "enable" and "disable" - the latter
must be queried for forbidden_project_ids.
  • Loading branch information
sbahling authored and adrianschroeter committed Jul 5, 2013
1 parent 4a72ead commit d2c11a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/project_user_role_relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.forbidden_project_ids
project_user_cache = Rails.cache.fetch(FORBIDDEN_PROJECT_IDS_CACHE_KEY) do
puc = Hash.new
ProjectUserRoleRelationship.find_by_sql("SELECT ur.db_project_id, ur.bs_user_id from flags f,
project_user_role_relationships ur where f.flag = 'access' and ur.db_project_id = f.db_project_id").each do |r|
project_user_role_relationships ur where f.flag = 'access' and f.status = 'disable' and ur.db_project_id = f.db_project_id").each do |r|
puc[r.db_project_id.to_i] ||= Hash.new
puc[r.db_project_id][r.bs_user_id] = 1
end
Expand Down

0 comments on commit d2c11a9

Please sign in to comment.