Exemplo n.º 1
0
class MemberRole(db.Model):
    member = db.Column(db.String(36),
                       db.ForeignKey('member.uuid'),
                       primary_key=True)
    role = db.Column(db.String(36),
                     db.ForeignKey('role.uuid'),
                     primary_key=True)
Exemplo n.º 2
0
class Approval(db.Model):
    member = db.Column(db.String(36),
                       db.ForeignKey('member.uuid'),
                       primary_key=True)
    decision = db.Column(db.String(36),
                         db.ForeignKey('decision.uuid'),
                         primary_key=True)
Exemplo n.º 3
0
class PolicyRole(db.Model):
    """
    defines RO/RW permissions on a decision for roles associated with a policy.
    Additionally, members with roles that have write permissions for decisions
    associated with this policy may create decisions that use this policy.
    """
    policy = db.Column(db.String(36),
                       db.ForeignKey('policy.uuid'),
                       primary_key=True)
    role = db.Column(db.String(36),
                     db.ForeignKey('role.uuid'),
                     primary_key=True)
    read = db.Column(db.Boolean())
    write = db.Column(db.Boolean())
    quorum_weight = db.Column(db.Integer())
Exemplo n.º 4
0
class Server(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    fqdn = db.Column(db.String(128))
    port = db.Column(db.Integer, default=443)

    def __repr__(self):
        return '{}:{}'.format(self.fqdn, self.port)
Exemplo n.º 5
0
class Organization(db.Model):
    '''
    Key concepts:
        member_role: This is the role that signifies the membership to this
            organization, therefore, all members of an organization have
            this role.
        mod_role: Members of the organization's mod role have the exclusive
            permission to create decisions flagged with mod_role_req.
            Default plugin meta_plugin has functions create_policy(),
            create_role(), and add_member_to_org(), which are flagged
            with this property.
    '''
    uuid = db.Column(db.String(36), primary_key=True)
    name = db.Column(db.String(128))
    server = db.Column(db.Integer, db.ForeignKey('server.id'))
    member_role = db.Column(db.String, db.ForeignKey('role.uuid'))
    mod_role = db.Column(db.String, db.ForeignKey('role.uuid'))
Exemplo n.º 6
0
class Decision(db.Model):
    uuid = db.Column(db.String(36), unique=True, primary_key=True)
    title = db.Column(db.String(512))
    org = db.Column(db.String(36), db.ForeignKey('organization.uuid'))
    author = db.Column(db.String(36), db.ForeignKey('member.uuid'))
    plugin = db.Column(db.Integer, db.ForeignKey('plugin.uuid'))
    directory = db.Column(db.String(512))
    policy = db.Column(db.String(36), db.ForeignKey('policy.uuid'))
Exemplo n.º 7
0
class Role(db.Model):
    uuid = db.Column(db.String(36), primary_key=True)
    name = db.Column(db.String(128))
    org = db.Column(db.String(36), db.ForeignKey('organization.uuid'))
Exemplo n.º 8
0
class Plugin(db.Model):
    uuid = db.Column(db.String(36), primary_key=True)
    title = db.Column(db.String(128), unique=True)
    module_name = db.Column(db.String(128))
    path = db.Column(db.String(1024), unique=True)
Exemplo n.º 9
0
class MemberDigest(db.Model):
    member = db.Column(db.String(36),
                       db.ForeignKey('member.uuid'),
                       primary_key=True)
    digest = db.Column(db.String(160))
Exemplo n.º 10
0
class Member(db.Model):
    uuid = db.Column(db.String(36), unique=True, primary_key=True)
    email = db.Column(db.String(256), unique=True)
    name = db.Column(db.String(128))
    server = db.Column(db.Integer, db.ForeignKey('server.id'))
Exemplo n.º 11
0
class Configuration(db.Model):
    name = db.Column(db.String(64), primary_key=True, unique=True)
    any_member_may_create_orgs = db.Column(db.Boolean, default=True)
    open_enrollment = db.Column(db.Boolean, default=True)
    decision_path = db.Column(db.String(128))
    public_org = db.Column(db.String, db.ForeignKey('organization.uuid'))
Exemplo n.º 12
0
class Policy(db.Model):
    uuid = db.Column(db.String(36), primary_key=True)
    name = db.Column(db.String(128))