Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (21 sloc) 0.823 kb
from trac.core import *
from trac.perm import IPermissionGroupProvider
from trac.util import TracError
class GodAuthPermissionGroupProvider(Component):
implements(IPermissionGroupProvider)
def get_permission_groups(self, username):
groups = ['anonymous']
if username == 'Anonymous':
return groups
# gah! we don't actually get passed the reqeust, since trac works in an
# odd way. this is going to require some re-engineering
#user = req.get_header("godauth-user")
#roles = req.get_header("godauth-roles")
user = None
roles = None
if user is not None:
if roles is not None:
roles = roles.split(',')
for role in roles:
groups.append(role)
return groups
Jump to Line
Something went wrong with that request. Please try again.