##// END OF EJS Templates
fixed #113 to high permission was required to fork a repository
marcink -
r1054:32dbf759 beta
parent child Browse files
Show More
@@ -47,10 +47,10 log = logging.getLogger(__name__)
47 class SettingsController(BaseRepoController):
47 class SettingsController(BaseRepoController):
48
48
49 @LoginRequired()
49 @LoginRequired()
50 @HasRepoPermissionAllDecorator('repository.admin')
51 def __before__(self):
50 def __before__(self):
52 super(SettingsController, self).__before__()
51 super(SettingsController, self).__before__()
53
52
53 @HasRepoPermissionAllDecorator('repository.admin')
54 def index(self, repo_name):
54 def index(self, repo_name):
55 repo_model = RepoModel()
55 repo_model = RepoModel()
56 c.repo_info = repo = repo_model.get_by_repo_name(repo_name)
56 c.repo_info = repo = repo_model.get_by_repo_name(repo_name)
@@ -93,6 +93,7 class SettingsController(BaseRepoControl
93 force_defaults=False
93 force_defaults=False
94 )
94 )
95
95
96 @HasRepoPermissionAllDecorator('repository.admin')
96 def update(self, repo_name):
97 def update(self, repo_name):
97 repo_model = RepoModel()
98 repo_model = RepoModel()
98 changed_name = repo_name
99 changed_name = repo_name
@@ -124,7 +125,7 class SettingsController(BaseRepoControl
124 return redirect(url('repo_settings_home', repo_name=changed_name))
125 return redirect(url('repo_settings_home', repo_name=changed_name))
125
126
126
127
127
128 @HasRepoPermissionAllDecorator('repository.admin')
128 def delete(self, repo_name):
129 def delete(self, repo_name):
129 """DELETE /repos/repo_name: Delete an existing item"""
130 """DELETE /repos/repo_name: Delete an existing item"""
130 # Forms posted to this method should contain a hidden field:
131 # Forms posted to this method should contain a hidden field:
@@ -156,6 +157,7 class SettingsController(BaseRepoControl
156
157
157 return redirect(url('home'))
158 return redirect(url('home'))
158
159
160 @HasRepoPermissionAllDecorator('repository.read')
159 def fork(self, repo_name):
161 def fork(self, repo_name):
160 repo_model = RepoModel()
162 repo_model = RepoModel()
161 c.repo_info = repo = repo_model.get_by_repo_name(repo_name)
163 c.repo_info = repo = repo_model.get_by_repo_name(repo_name)
@@ -171,7 +173,7 class SettingsController(BaseRepoControl
171 return render('settings/repo_fork.html')
173 return render('settings/repo_fork.html')
172
174
173
175
174
176 @HasRepoPermissionAllDecorator('repository.read')
175 def fork_create(self, repo_name):
177 def fork_create(self, repo_name):
176 repo_model = RepoModel()
178 repo_model = RepoModel()
177 c.repo_info = repo_model.get_by_repo_name(repo_name)
179 c.repo_info = repo_model.get_by_repo_name(repo_name)
@@ -233,8 +233,8
233 %else:
233 %else:
234 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
234 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
235 %endif
235 %endif
236 %endif
236 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
237 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
237 %endif
238 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
238 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
239
239
240 %if h.HasPermissionAll('hg.admin')('access admin main page'):
240 %if h.HasPermissionAll('hg.admin')('access admin main page'):
General Comments 0
You need to be logged in to leave comments. Login now