Implement sme basic role matchers
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 19 Feb 2018 16:08:55 +0000 (17:08 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 19 Feb 2018 16:08:55 +0000 (17:08 +0100)
master.cfg

index 802ed6c..ffadcab 100644 (file)
@@ -347,25 +347,47 @@ c['configurators'] = [util.JanitorConfigurator(
     hour=12,
     dayOfWeek=6)]
 
+
 # WWW
 c['www'] = dict(port=8010,
                 plugins={'console_view': {},
                          'grid_view': {},
                          'waterfall_view': {}})
 
+# Access
+authz = util.Authz(
+    stringsMatcher=util.fnmatchStrMatcher,  # simple matcher with '*' glob character
+    # stringsMatcher = util.reStrMatcher,   # if you prefer regular expressions
+    allowRules=[
+        # admins can do anything,
+        # defaultDeny=False: if user does not have the admin role, we continue parsing rules
+        util.AnyEndpointMatcher(role="admins", defaultDeny=False),
+
+        # Defaulting old config, everyone can stop build.
+        util.StopBuildEndpointMatcher(role="*"),
+
+        # if future Buildbot implement new control, we are safe with this last rule
+        util.AnyControlEndpointMatcher(role="admins")
+    ],
+)
+c['www']['authz'] = authz
+
 # PROJECT IDENTITY
 c['projectName'] = "Blender"
-c['projectURL'] = "https://www.blender.org"
+#c['projectURL'] = "https://www.blender.org"
+c['projectURL'] = "http://localhost:8010/"
 
 # Buildbot information
-c['buildbotURL'] = "https://builder.blender.org/admin/"
+# c['buildbotURL'] = "https://builder.blender.org/admin/"
+c['buildbotURL'] = "http://localhost:8010/"
 c['buildbotNetUsageData'] = 'basic'
 
 # Various
 c['db_url'] = "sqlite:///state.sqlite"
 
 c['title'] = "Blender"
-c['titleURL'] = "https://builder.blender.org/"
+#c['titleURL'] = "https://builder.blender.org/"
+c['titleURL'] = "http://localhost:8010/"
 
 # Disable sending of 'buildbotNetUsageData' for now, to improve startup time.
 c['buildbotNetUsageData'] = None