• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


コミットメタ情報

リビジョン97e006e69f52318307e88ebaa66a2d4b9c772b07 (tree)
日時2012-06-06 21:04:56
作者bolkimen <bolkimen@yaho...>
コミッターbolkimen

ログメッセージ

[#3892] ticket:76 write = create + update

変更サマリ

差分

--- a/ForgeTracker/forgetracker/templates/tracker/ticket.html
+++ b/ForgeTracker/forgetracker/templates/tracker/ticket.html
@@ -143,7 +143,7 @@
143143 {% endblock %}
144144
145145 {% block extra_js %}
146- {% if h.has_access(ticket, 'write')() %}
146+ {% if h.has_access(ticket, 'update')() %}
147147 <script type="text/javascript">
148148 $(document).ready(function () {
149149 // show/hide form
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -173,7 +173,7 @@ class TestFunctionalController(TrackerTestController):
173173 index_view = self.app.get('/bugs/')
174174 assert 'No open tickets found.' in index_view
175175 assert 'Create Ticket' in index_view
176- # No 'Create Ticket' button for user without 'write' perm
176+ # No 'Create Ticket' button for user without 'create' perm
177177 r = self.app.get('/bugs/', extra_environ=dict(username='*anonymous'))
178178 assert 'Create Ticket' not in r
179179
@@ -879,7 +879,8 @@ class TestMilestoneAdmin(TrackerTestController):
879879 def post_install_hook(app):
880880 role_anon = M.ProjectRole.by_name('*anonymous')._id
881881 app.config.acl.append(M.ACE.allow(role_anon, 'post'))
882- app.config.acl.append(M.ACE.allow(role_anon, 'write'))
882+ app.config.acl.append(M.ACE.allow(role_anon, 'create'))
883+ app.config.acl.append(M.ACE.allow(role_anon, 'update'))
883884
884885 class TestEmailMonitoring(TrackerTestController):
885886 def __init__(self):
--- a/ForgeTracker/forgetracker/tests/test_tracker_roles.py
+++ b/ForgeTracker/forgetracker/tests/test_tracker_roles.py
@@ -23,7 +23,8 @@ def test_role_assignments():
2323 return pred(user=admin), pred(user=user), pred(user=anon)
2424 assert check_access('configure') == (True, False, False)
2525 assert check_access('read') == (True, True, True)
26- assert check_access('write') == (True, False, False)
26+ assert check_access('update') == (True, False, False)
27+ assert check_access('create') == (True, False, False)
2728 assert check_access('unmoderated_post') == (True, True, False)
2829 assert check_access('post') == (True, True, False)
2930 assert check_access('moderate') == (True, False, False)
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -80,24 +80,32 @@ class TestTicketModel(TrackerTestWithModel):
8080 ACE.allow(role_creator, ALL_PERMISSIONS),
8181 DENY_ALL]
8282 assert has_access(t, 'read', user=admin)()
83- assert has_access(t, 'write', user=admin)()
83+ assert has_access(t, 'create', user=admin)()
84+ assert has_access(t, 'update', user=admin)()
8485 assert has_access(t, 'read', user=creator)()
85- assert has_access(t, 'write', user=creator)()
86+ assert has_access(t, 'create', user=creator)()
87+ assert has_access(t, 'update', user=creator)()
8688 assert has_access(t, 'read', user=developer)()
87- assert has_access(t, 'write', user=developer)()
89+ assert has_access(t, 'create', user=developer)()
90+ assert has_access(t, 'update', user=developer)()
8891 assert not has_access(t, 'read', user=observer)()
89- assert not has_access(t, 'write', user=observer)()
92+ assert not has_access(t, 'create', user=observer)()
93+ assert not has_access(t, 'update', user=observer)()
9094 assert not has_access(t, 'read', user=anon)()
91- assert not has_access(t, 'write', user=anon)()
95+ assert not has_access(t, 'create', user=anon)()
96+ assert not has_access(t, 'update', user=anon)()
9297
9398 t.private = False
9499 assert t.acl == []
95100 assert has_access(t, 'read', user=admin)()
96- assert has_access(t, 'write', user=admin)()
101+ assert has_access(t, 'create', user=admin)()
102+ assert has_access(t, 'update', user=admin)()
97103 assert has_access(t, 'read', user=developer)()
98- assert has_access(t, 'write', user=developer)()
104+ assert has_access(t, 'create', user=developer)()
105+ assert has_access(t, 'update', user=developer)()
99106 assert has_access(t, 'read', user=creator)()
100107 assert has_access(t, 'unmoderated_post', user=creator)()
101- assert not has_access(t, 'write', user=creator)()
108+ assert not has_access(t, 'create', user=creator)()
109+ assert not has_access(t, 'update', user=creator)()
102110 assert has_access(t, 'read', user=observer)()
103111 assert has_access(t, 'read', user=anon)()
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -100,7 +100,7 @@ class W:
100100
101101 class ForgeTrackerApp(Application):
102102 __version__ = version.__version__
103- permissions = ['configure', 'read', 'write', 'save_searches',
103+ permissions = ['configure', 'read', 'update', 'create', 'save_searches',
104104 'unmoderated_post', 'post', 'moderate', 'admin']
105105 config_options = Application.config_options + [
106106 ConfigOption('TicketMonitoringEmail', str, ''),
@@ -190,7 +190,7 @@ class ForgeTrackerApp(Application):
190190 ticket = None
191191
192192 links = []
193- if has_access(self, 'write')():
193+ if has_access(self, 'create')():
194194 links.append(SitemapEntry('Create Ticket',
195195 self.config.url() + 'new/', ui_icon=g.icons['plus']))
196196 if has_access(self, 'configure')():
@@ -260,7 +260,8 @@ class ForgeTrackerApp(Application):
260260 M.ACE.allow(role_anon, 'read'),
261261 M.ACE.allow(role_auth, 'post'),
262262 M.ACE.allow(role_auth, 'unmoderated_post'),
263- M.ACE.allow(role_developer, 'write'),
263+ M.ACE.allow(role_developer, 'update'),
264+ M.ACE.allow(role_developer, 'create'),
264265 M.ACE.allow(role_developer, 'moderate'),
265266 M.ACE.allow(role_developer, 'save_searches'),
266267 M.ACE.allow(role_admin, 'configure'),
@@ -404,7 +405,7 @@ class RootController(BaseController):
404405 columns=columns, page=page, **kw)
405406 c.subscribe_form = W.subscribe_form
406407 result['subscribed'] = M.Mailbox.subscribed()
407- result['allow_edit'] = has_access(c.app, 'write')()
408+ result['allow_edit'] = has_access(c.app, 'update')()
408409 result['help_msg'] = c.app.config.options.get('TicketHelpSearch')
409410 result['url_q'] = c.app.globals.not_closed_query
410411 result['url_sort'] = ''
@@ -501,7 +502,7 @@ class RootController(BaseController):
501502 if project:
502503 redirect(c.project.url() + 'search?' + urlencode(dict(q=q, history=kw.get('history'))))
503504 result = self.paged_query(q, page=page, sort=sort, columns=columns, **kw)
504- result['allow_edit'] = has_access(c.app, 'write')()
505+ result['allow_edit'] = has_access(c.app, 'update')()
505506 result['bin'] = bin
506507 result['help_msg'] = c.app.config.options.get('TicketHelpSearch')
507508 c.ticket_search_results = W.ticket_search_results
@@ -544,7 +545,7 @@ class RootController(BaseController):
544545 @with_trailing_slash
545546 @expose('jinja:forgetracker:templates/tracker/new_ticket.html')
546547 def new(self, super_id=None, **kw):
547- require_access(c.app, 'write')
548+ require_access(c.app, 'create')
548549 c.ticket_form = W.ticket_form
549550 help_msg = c.app.config.options.get('TicketHelpNew')
550551 return dict(action=c.app.config.url()+'save_ticket',
@@ -599,9 +600,9 @@ class RootController(BaseController):
599600 ticket_num=ticket_num)
600601 if not ticket:
601602 raise Exception('Ticket number not found.')
602- require_access(ticket, 'write')
603+ require_access(ticket, 'update')
603604 else:
604- require_access(c.app, 'write')
605+ require_access(c.app, 'create')
605606 ticket = TM.Ticket.new()
606607 ticket.update(ticket_form)
607608 redirect(str(ticket.ticket_num)+'/')
@@ -613,7 +614,7 @@ class RootController(BaseController):
613614 page=validators.Int(if_empty=0),
614615 sort=validators.UnicodeString(if_empty='ticket_num_i asc')))
615616 def edit(self, q=None, limit=None, page=None, sort=None, **kw):
616- require_access(c.app, 'write')
617+ require_access(c.app, 'update')
617618 result = self.paged_query(q, sort=sort, limit=limit, page=page, **kw)
618619 # if c.app.globals.milestone_names is None:
619620 # c.app.globals.milestone_names = ''
@@ -634,7 +635,7 @@ class RootController(BaseController):
634635 _id={'$in':[ObjectId(id) for id in post_data['selected'].split(',')]},
635636 app_config_id=c.app.config._id)).all()
636637 for ticket in tickets:
637- require_access(ticket, 'write')
638+ require_access(ticket, 'update')
638639
639640 fields = set(['status'])
640641 values = {}
@@ -1012,7 +1013,7 @@ class TicketController(BaseController):
10121013 post_count = self.ticket.discussion_thread.post_count
10131014 limit, page = h.paging_sanitizer(limit, page, post_count)
10141015 return dict(ticket=self.ticket, globals=c.app.globals,
1015- allow_edit=has_access(self.ticket, 'write')(),
1016+ allow_edit=has_access(self.ticket, 'update')(),
10161017 tool_subscribed=tool_subscribed,
10171018 subscribed=subscribed,
10181019 page=page, limit=limit, count=post_count)
@@ -1073,7 +1074,7 @@ class TicketController(BaseController):
10731074
10741075 @require_post()
10751076 def _update_ticket(self, post_data):
1076- require_access(self.ticket, 'write')
1077+ require_access(self.ticket, 'update')
10771078 changes = changelog()
10781079 comment = post_data.pop('comment', None)
10791080 labels = post_data.pop('labels', None) or []
@@ -1180,7 +1181,7 @@ class TicketController(BaseController):
11801181
11811182 class AttachmentController(ac.AttachmentController):
11821183 AttachmentClass = TM.TicketAttachment
1183- edit_perm = 'write'
1184+ edit_perm = 'update'
11841185
11851186 class AttachmentsController(ac.AttachmentsController):
11861187 AttachmentControllerClass = AttachmentController
@@ -1340,7 +1341,7 @@ class RootRestController(BaseController):
13401341 @require_post()
13411342 @validate(W.ticket_form, error_handler=h.json_validation_error)
13421343 def new(self, ticket_form=None, **post_data):
1343- require_access(c.app, 'write')
1344+ require_access(c.app, 'create')
13441345 c.app.globals.invalidate_bin_counts()
13451346 if c.app.globals.milestone_names is None:
13461347 c.app.globals.milestone_names = ''
@@ -1403,7 +1404,7 @@ class TicketRestController(BaseController):
14031404 @require_post()
14041405 @validate(W.ticket_form, error_handler=h.json_validation_error)
14051406 def save(self, ticket_form=None, **post_data):
1406- require_access(self.ticket, 'write')
1407+ require_access(self.ticket, 'update')
14071408 c.app.globals.invalidate_bin_counts()
14081409 # if c.app.globals.milestone_names is None:
14091410 # c.app.globals.milestone_names = ''
@@ -1439,7 +1440,7 @@ class MilestoneController(BaseController):
14391440 require(has_access(c.app, 'read'))
14401441 result = TM.Ticket.paged_query(
14411442 self.mongo_query, page=page, sort=sort, columns=columns, **kw)
1442- result['allow_edit'] = has_access(c.app, 'write')()
1443+ result['allow_edit'] = has_access(c.app, 'update')()
14431444 result['help_msg'] = c.app.config.options.get('TicketHelpSearch')
14441445 progress = c.app.globals.milestone_count(self.progress_key)
14451446 result.pop('q')
@@ -1465,7 +1466,7 @@ class MilestoneController(BaseController):
14651466 page=validators.Int(if_empty=0),
14661467 sort=validators.UnicodeString(if_empty='ticket_num_i asc')))
14671468 def edit(self, q=None, limit=None, page=None, sort=None, columns=None, **kw):
1468- require_access(c.app, 'write')
1469+ require_access(c.app, 'update')
14691470 result = TM.Ticket.paged_query(
14701471 self.mongo_query, page=page, sort=sort, columns=columns, **kw)
14711472 # if c.app.globals.milestone_names is None:
@@ -1486,7 +1487,7 @@ class MilestoneController(BaseController):
14861487 _id={'$in':[ObjectId(id) for id in post_data['selected'].split(',')]},
14871488 app_config_id=c.app.config._id)).all()
14881489 for ticket in tickets:
1489- require_access(ticket, 'write')
1490+ require_access(ticket, 'update')
14901491
14911492 fields = set(['status'])
14921493 values = {}