chore: Serialize domain policies on team (#1970)

* domain policies exposed on team, consistency

* fix: Remove usage of isAdmin in frontend

* test
This commit is contained in:
Tom Moor
2021-03-22 20:50:12 -07:00
committed by GitHub
parent b3353f20d5
commit 349e971a8a
26 changed files with 258 additions and 145 deletions

View File

@ -3,7 +3,7 @@ import randomstring from "randomstring";
import { DataTypes, sequelize } from "../sequelize";
const ApiKey = sequelize.define(
"apiKeys",
"apiKey",
{
id: {
type: DataTypes.UUID,
@ -12,17 +12,8 @@ const ApiKey = sequelize.define(
},
name: DataTypes.STRING,
secret: { type: DataTypes.STRING, unique: true },
// TODO: remove this, as it's redundant with associate below
userId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: "users",
},
},
},
{
tableName: "apiKeys",
paranoid: true,
hooks: {
beforeValidate: (key) => {