Mercurial > hg > soundsoftware-site
comparison app/models/project.rb @ 1519:afce8026aaeb redmine-2.4-integration
Merge from branch "live"
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:34:53 +0100 |
parents | c86dacc2ef0a 467282ce64a4 |
children | a1bdbf8a87d5 |
comparison
equal
deleted
inserted
replaced
1518:2e8063097240 | 1519:afce8026aaeb |
---|---|
161 # Project.visible_condition(anonymous) => "((projects.status = 1) AND (projects.is_public = 1))" | 161 # Project.visible_condition(anonymous) => "((projects.status = 1) AND (projects.is_public = 1))" |
162 def self.visible_condition(user, options={}) | 162 def self.visible_condition(user, options={}) |
163 allowed_to_condition(user, :view_project, options) | 163 allowed_to_condition(user, :view_project, options) |
164 end | 164 end |
165 | 165 |
166 def self.root_visible_by(user=nil) | 166 def self.root_visible_by(user, options={}) |
167 return "#{Project.table_name}.parent_id IS NULL AND " + visible_condition(user) | 167 return "#{Project.table_name}.parent_id IS NULL AND " + visible_condition(user, options) |
168 end | 168 end |
169 | 169 |
170 # Returns a SQL conditions string used to find all projects for which +user+ has the given +permission+ | 170 # Returns a SQL conditions string used to find all projects for which +user+ has the given +permission+ |
171 # | 171 # |
172 # Valid options: | 172 # Valid options: |