{
  "name": "OpenframeUser",
  "plural": "users",
  "base": "User",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "mixins": {
    "Timestamp": {},
    "IsPublicOrOwner": {
      "methods": [
        "prototype.__get__created_artwork",
        "prototype.__findById__created_artwork",
        "prototype.__findOne__created_artwork",
        "prototype.__count__created_artwork",
        "prototype.__get__liked_artwork",
        "prototype.__findById__liked_artwork",
        "prototype.__findOne__liked_artwork",
        "prototype.__count__liked_artwork",
        "prototype.__get__purchased_artwork",
        "prototype.__findById__purchased_artwork",
        "prototype.__findOne__purchased_artwork",
        "prototype.__count__purchased_artwork"
      ]
    }
  },
  "hidden": [
    "emailVerified",
    "email",
    "password",
    "settings"
  ],
  "protected": [
    "email",
    "created",
    "modified",
    "settings"
  ],
  "scope": {
    "order": "created"
  },
  "properties": {
    "bio": {
      "type": "string"
    },
    "website": {
      "type": "string"
    },
    "twitter": {
      "type": "string"
    },
    "full_name": {
      "type": "string"
    },
    "settings": {
      "type": "object",
      "default": {
        "enable_notifications": true
      }
    }
  },
  "validations": [],
  "relations": {
    "owned_frames": {
      "type": "hasMany",
      "model": "Frame",
      "foreignKey": "ownerId"
    },
    "managed_frames": {
      "type": "hasAndBelongsToMany",
      "model": "Frame"
    },
    "owned_channels": {
      "type": "hasMany",
      "model": "Channel",
      "foreignKey": "ownerId"
    },
    "managed_channels": {
      "type": "hasAndBelongsToMany",
      "model": "Channel",
      "foreignKey": "managersId",
      "through": "ChannelManager"
    },
    "subscribed_channels": {
      "type": "hasAndBelongsToMany",
      "model": "Channel",
      "foreignKey": "subscribersId",
      "through": "ChannelSubscriber"
    },
    "collections": {
      "type": "hasMany",
      "model": "Collection",
      "foreignKey": "ownerId"
    },
    "subscribed_collections": {
      "type": "hasAndBelongsToMany",
      "model": "Collection",
      "foreignKey": "subscribersId",
      "through": "CollectionSubscriber"
    },
    "created_artwork": {
      "type": "hasMany",
      "model": "Artwork",
      "foreignKey": "ownerId"
    },
    "purchased_artwork": {
      "type": "hasAndBelongsToMany",
      "model": "Artwork",
      "foreignKey": "purchasedById"
    },
    "liked_artwork": {
      "type": "hasAndBelongsToMany",
      "model": "Artwork",
      "foreignKey": "likedById"
    },
    "identities": {
      "type": "hasMany",
      "model": "OpenframeUserIdentity",
      "foreignKey": "userId"
    },
    "credentials": {
      "type": "hasMany",
      "model": "OpenframeUserCredential",
      "foreignKey": "userId"
    }
  },
  "acls": [
    {
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "DENY"
    },
    {
      "accessType": "READ",
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW",
      "property": [
        "find",
        "findById",
        "findOne",
        "config",
        "__get__created_artwork"
      ]
    },
    {
      "accessType": "READ",
      "principalType": "ROLE",
      "principalId": "$owner",
      "permission": "ALLOW"
    },
    {
      "accessType": "WRITE",
      "principalType": "ROLE",
      "principalId": "$owner",
      "permission": "ALLOW"
    },
    {
      "accessType": "EXECUTE",
      "principalType": "ROLE",
      "principalId": "$owner",
      "permission": "ALLOW",
      "property": [
        "all_frames"
      ]
    },
    {
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "admin",
      "permission": "ALLOW"
    }
  ],
  "methods": {}
}
