• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

allura


Commit MetaInfo

Revisiónb71963345ea3a1be72ff9c68865ca21d934c927e (tree)
Tiempo2011-04-28 03:48:20
AutorRick Copeland <rcopeland@geek...>
CommiterRick Copeland

Log Message

[#1909] Make bootstrap Projects nbhd the only one allowing willy-nilly registration

Signed-off-by: Rick Copeland <rcopeland@geek.net>

Cambiar Resumen

Diferencia incremental

--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -23,6 +23,7 @@ from ming.orm import session
2323 from ming.orm import ThreadLocalORMSession
2424
2525 from allura.lib import helpers as h
26+from allura.lib import security
2627 from allura.lib import exceptions as forge_exc
2728
2829 log = logging.getLogger(__name__)
@@ -292,7 +293,7 @@ class ProjectRegistrationProvider(object):
292293 '''
293294 return []
294295
295- def register_neighborhood_project(self, neighborhood, users):
296+ def register_neighborhood_project(self, neighborhood, users, allow_register=False):
296297 from allura import model as M
297298 shortname='--init--'
298299 p = M.Project.query.get(
@@ -321,6 +322,9 @@ class ProjectRegistrationProvider(object):
321322 ThreadLocalORMSession.close_all()
322323 log.exception('Error registering project %s' % p)
323324 raise
325+ if allow_register:
326+ role_auth = M.ProjectRole.authenticated(p)
327+ security.simple_grant(p.acl, role_auth._id, 'register')
324328 return p
325329
326330 def register_project(self, neighborhood, shortname, user, user_project):
--- a/Allura/allura/websetup/bootstrap.py
+++ b/Allura/allura/websetup/bootstrap.py
@@ -87,7 +87,7 @@ def bootstrap(command, conf, vars):
8787 n_adobe = M.Neighborhood(name='Adobe', url_prefix='/adobe/')
8888 assert tg.config['auth.method'] == 'local'
8989 project_reg = plugin.ProjectRegistrationProvider.get()
90- p_projects = project_reg.register_neighborhood_project(n_projects, [root])
90+ p_projects = project_reg.register_neighborhood_project(n_projects, [root], allow_register=True)
9191 p_users = project_reg.register_neighborhood_project(n_users, [root])
9292 p_adobe = project_reg.register_neighborhood_project(n_adobe, [root])
9393 ThreadLocalORMSession.flush_all()