Merge "Add a 'security' flag to Teams"
This commit is contained in:
commit
4dcf96d324
@ -197,11 +197,15 @@ class Team(base.APIBase):
|
|||||||
description = wtypes.text
|
description = wtypes.text
|
||||||
"""Details about the team."""
|
"""Details about the team."""
|
||||||
|
|
||||||
|
security = bool
|
||||||
|
"""Whether or not the team is responsible for managing security issues."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def sample(cls):
|
def sample(cls):
|
||||||
return cls(
|
return cls(
|
||||||
name="StoryBoard-core",
|
name="StoryBoard-core",
|
||||||
description="Core reviewers of StoryBoard team.")
|
description="Core reviewers of StoryBoard team.",
|
||||||
|
security=False)
|
||||||
|
|
||||||
|
|
||||||
class Story(base.APIBase):
|
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'),
|
schema.UniqueConstraint('name', name='uniq_team_name'),
|
||||||
)
|
)
|
||||||
name = Column(Unicode(CommonLength.top_middle_length))
|
name = Column(Unicode(CommonLength.top_middle_length))
|
||||||
|
security = Column(Boolean, default=False)
|
||||||
users = relationship("User", secondary="team_membership")
|
users = relationship("User", secondary="team_membership")
|
||||||
permissions = relationship("Permission", secondary="team_permissions",
|
permissions = relationship("Permission", secondary="team_permissions",
|
||||||
backref="teams")
|
backref="teams")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user