| 23 |
23 |
before_action :find_project, :except => [ :index, :autocomplete, :list, :new, :create, :copy ]
|
| 24 |
24 |
before_action :authorize, :except => [ :index, :autocomplete, :list, :new, :create, :copy, :archive, :unarchive, :destroy]
|
| 25 |
25 |
before_action :authorize_global, :only => [:new, :create]
|
| 26 |
|
before_action :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ]
|
|
26 |
before_action :require_admin, :only => [ :archive, :unarchive, :destroy ]
|
|
27 |
before_action :require_edit_permission_to_copy, :only => [ :copy ]
|
|
28 |
|
| 27 |
29 |
accept_rss_auth :index
|
| 28 |
30 |
accept_api_auth :index, :show, :create, :update, :destroy
|
| 29 |
31 |
require_sudo_mode :destroy
|
| ... | ... | |
| 34 |
36 |
helper :repositories
|
| 35 |
37 |
helper :members
|
| 36 |
38 |
|
|
39 |
def require_edit_permission_to_copy
|
|
40 |
current_project = Project.find(params[:id])
|
|
41 |
allowed = User.current.allowed_to?({:controller => 'projects', :action => 'edit'}, current_project, :global => false)
|
|
42 |
unless allowed
|
|
43 |
render_403
|
|
44 |
end
|
|
45 |
end
|
|
46 |
|
| 37 |
47 |
# Lists visible projects
|
| 38 |
48 |
def index
|
| 39 |
49 |
# try to redirect to the requested menu item
|