Add a 'security' flag to Teams
This will be used to determine whether or not a Team is responsible for (and therefore should be automatically subscribed to) security issues. Change-Id: I0869e9acc366f3a5546b4e39d736a229762999c2
This commit is contained in:
parent
32e7fdb632
commit
81e7f115bb
@ -197,11 +197,15 @@ class Team(base.APIBase):
|
||||
description = wtypes.text
|
||||
"""Details about the team."""
|
||||
|
||||
security = bool
|
||||
"""Whether or not the team is responsible for managing security issues."""
|
||||
|
||||
@classmethod
|
||||
def sample(cls):
|
||||
return cls(
|
||||
name="StoryBoard-core",
|
||||
description="Core reviewers of StoryBoard team.")
|
||||
description="Core reviewers of StoryBoard team.",
|
||||
security=False)
|
||||
|
||||
|
||||
class Story(base.APIBase):
|
||||
|
@ -0,0 +1,36 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Add a 'security' flag to Teams
|
||||
|
||||
Revision ID: 064
|
||||
Revises: 063
|
||||
Create Date: 2019-03-04 16:24:44.264120
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '064'
|
||||
down_revision = '063'
|
||||
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
op.add_column('teams', sa.Column('security', sa.Boolean(), nullable=True))
|
||||
|
||||
|
||||
def downgrade(active_plugins=None, options=None):
|
||||
op.drop_column('teams', 'security')
|
@ -211,6 +211,7 @@ class Team(ModelBuilder, Base):
|
||||
schema.UniqueConstraint('name', name='uniq_team_name'),
|
||||
)
|
||||
name = Column(Unicode(CommonLength.top_middle_length))
|
||||
security = Column(Boolean, default=False)
|
||||
users = relationship("User", secondary="team_membership")
|
||||
permissions = relationship("Permission", secondary="team_permissions",
|
||||
backref="teams")
|
||||
|
Loading…
x
Reference in New Issue
Block a user