Is it safe to authorize user models using `instanceof` in JavaScript / TypeScript?

后端 未结 0 1962
野性不改
野性不改 2020-12-01 01:39

Let\'s say I have 3 models: Admin, User, Product (I\'m using model classes)

Only an admin can ADD, UPDATE, DELETE a product and users can only GET products, so I have

相关标签:
回答
  • 消灭零回复
提交回复
热议问题