Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Side by Side Diff: appengine/monorail/proto/usergroup_pb2.py

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/monorail/proto/user_pb2.py ('k') | appengine/monorail/queue.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is govered by a BSD-style
3 # license that can be found in the LICENSE file or at
4 # https://developers.google.com/open-source/licenses/bsd
5
6 """Protocol buffers for Monorail usergroups."""
7
8 from protorpc import messages
9
10
11 class MemberVisibility(messages.Enum):
12 """Enum controlling who can see the members of a user group."""
13 OWNERS = 0
14 MEMBERS = 1
15 ANYONE = 2
16
17
18 class GroupType(messages.Enum):
19 """Type of external group to import."""
20 CHROME_INFRA_AUTH = 0
21 MDB = 1
22 BAGGINS = 3
23
24
25 class UserGroupSettings(messages.Message):
26 """In-memory busines object for representing user group settings."""
27 who_can_view_members = messages.EnumField(
28 MemberVisibility, 1, default=MemberVisibility.MEMBERS)
29 ext_group_type = messages.EnumField(GroupType, 2)
30 last_sync_time = messages.IntegerField(
31 3, default=0, variant=messages.Variant.INT32)
32 friend_projects = messages.IntegerField(
33 4, repeated=True, variant=messages.Variant.INT32)
34 # TODO(jrobbins): add settings to control who can join, etc.
35
36
37 def MakeSettings(who_can_view_members_str, ext_group_type_str=None,
38 last_sync_time=0, friend_projects=[]):
39 """Create and return a new user record in RAM."""
40 settings = UserGroupSettings(
41 who_can_view_members=MemberVisibility(who_can_view_members_str.upper()))
42 if ext_group_type_str:
43 settings.ext_group_type = GroupType(ext_group_type_str.upper())
44 settings.last_sync_time = last_sync_time
45 settings.friend_projects = friend_projects
46 return settings
OLDNEW
« no previous file with comments | « appengine/monorail/proto/user_pb2.py ('k') | appengine/monorail/queue.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698