visible(user).find(:all, :limit => count, :order => "created_on DESC")
end
+ # Returns true if the project is visible to +user+ or to the current user.
+ def visible?(user=User.current)
+ user.allowed_to?(:view_project, self)
+ end
+
def self.visible_by(user=nil)
ActiveSupport::Deprecation.warn "Project.visible_by is deprecated and will be removed in Redmine 1.3.0. Use Project.visible_condition instead."
visible_condition(user || User.current)
api.name project.name
api.identifier project.identifier
api.description project.description
- api.parent(:id => project.parent_id, :name => project.parent.name) unless project.parent.nil?
+ api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
render_api_custom_values project.visible_custom_field_values, api
api.identifier @project.identifier
api.description @project.description
api.homepage @project.homepage
+ api.parent(:id => @project.parent.id, :name => @project.parent.name) if @project.parent && @project.parent.visible?
render_api_custom_values @project.visible_custom_field_values, api