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.

38 lines
668 B

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