Feature #1543 » view_activity_permission_trunk.patch
| config/locales/en.yml (working copy) | ||
|---|---|---|
|
permission_manage_project_activities: Manage project activities
|
||
|
permission_manage_versions: Manage versions
|
||
|
permission_manage_categories: Manage issue categories
|
||
|
permission_view_activity: View Activity
|
||
|
permission_view_issues: View Issues
|
||
|
permission_add_issues: Add issues
|
||
|
permission_edit_issues: Edit issues
|
||
| config/locales/en-GB.yml (working copy) | ||
|---|---|---|
|
permission_manage_project_activities: Manage project activities
|
||
|
permission_manage_versions: Manage versions
|
||
|
permission_manage_categories: Manage issue categories
|
||
|
permission_view_activity: View Activity
|
||
|
permission_view_issues: View Issues
|
||
|
permission_add_issues: Add issues
|
||
|
permission_edit_issues: Edit issues
|
||
| lib/redmine.rb (working copy) | ||
|---|---|---|
|
# Permissions
|
||
|
Redmine::AccessControl.map do |map|
|
||
|
map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true, :read => true
|
||
|
map.permission :view_project, {:projects => [:show]}, :public => true, :read => true
|
||
|
map.permission :view_activity, {:activities => [:index]}, :read => true
|
||
|
map.permission :search_project, {:search => :index}, :public => true, :read => true
|
||
|
map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin
|
||
|
map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member
|
||
| app/views/projects/index.html.erb (working copy) | ||
|---|---|---|
|
<% end %>
|
||
|
<div class="contextual">
|
||
|
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
||
|
<%= link_to(l(:label_issue_view_all), issues_path) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
|
||
|
<%= link_to(l(:label_overall_spent_time), time_entries_path) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
|
||
|
<%= link_to l(:label_overall_activity),
|
||
|
{ :controller => 'activities', :action => 'index',
|
||
|
:id => nil } %>
|
||
|
<%= render_project_action_links %>
|
||
|
</div>
|
||
|
<h2><%= l(:label_project_plural) %></h2>
|
||
| app/helpers/projects_helper.rb (working copy) | ||
|---|---|---|
|
content_tag('select', options.html_safe, :name => 'project[parent_id]', :id => 'project_parent_id')
|
||
|
end
|
||
|
def render_project_action_links
|
||
|
links = []
|
||
|
links << link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true)
|
||
|
links << link_to(l(:label_issue_view_all), issues_path) if User.current.allowed_to?(:view_issues, nil, :global => true)
|
||
|
links << link_to(l(:label_overall_spent_time), time_entries_path) if User.current.allowed_to?(:view_time_entries, nil, :global => true)
|
||
|
links << link_to(l(:label_overall_activity), { :controller => 'activities', :action => 'index', :id => nil }) if User.current.allowed_to?(:view_activity, nil, :global => true)
|
||
|
links.join(" | ").html_safe
|
||
|
end
|
||
|
# Renders the projects index
|
||
|
def render_project_hierarchy(projects)
|
||
|
render_project_nested_lists(projects) do |project|
|
||
| app/controllers/users_controller.rb (working copy) | ||
|---|---|---|
|
def show
|
||
|
# show projects based on current user visibility
|
||
|
@memberships = @user.memberships.where(Project.visible_condition(User.current)).all
|
||
|
@events_by_day = []
|
||
|
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10)
|
||
|
@events_by_day = events.group_by(&:event_date)
|
||
|
if User.current.allowed_to?(:view_activity, nil, :global => true)
|
||
|
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10)
|
||
|
@events_by_day = events.group_by(&:event_date)
|
||
|
end
|
||
|
unless User.current.admin?
|
||
|
if !@user.active? || (@user != User.current && @memberships.empty? && events.empty?)
|
||
| app/controllers/activities_controller.rb (working copy) | ||
|---|---|---|
|
class ActivitiesController < ApplicationController
|
||
|
menu_item :activity
|
||
|
before_filter :find_optional_project
|
||
|
before_filter :authorize_global, :only => [ :index ]
|
||
|
accept_rss_auth :index
|
||
|
def index
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »