You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
654 B

  1. /**
  2. * Right schema
  3. */
  4. module.exports = (sequelize, DataTypes) => {
  5. let rightSchema = sequelize.define('right', {
  6. path: {
  7. type: DataTypes.STRING,
  8. allowNull: false
  9. },
  10. role: {
  11. type: DataTypes.ENUM('read', 'write', 'manage'),
  12. allowNull: false,
  13. defaultValue: 'read'
  14. },
  15. exact: {
  16. type: DataTypes.BOOLEAN,
  17. allowNull: false,
  18. defaultValue: false
  19. },
  20. allow: {
  21. type: DataTypes.BOOLEAN,
  22. allowNull: false,
  23. defaultValue: false
  24. }
  25. }, {
  26. timestamps: true,
  27. version: true,
  28. indexes: [
  29. {
  30. fields: ['path']
  31. }
  32. ]
  33. })
  34. return rightSchema
  35. }