2014-01-22 17:57:41 -05:00
|
|
|
Article = require('./Article')
|
|
|
|
Handler = require('../commons/Handler')
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
ArticleHandler = class ArticleHandler extends Handler
|
|
|
|
modelClass: Article
|
2014-03-07 20:05:35 -05:00
|
|
|
editableProperties: ['body', 'name', 'i18n']
|
2014-04-08 17:10:50 -04:00
|
|
|
jsonSchema: require './article_schema'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
hasAccess: (req) ->
|
|
|
|
req.method is 'GET' or req.user?.isAdmin()
|
|
|
|
|
2014-04-08 22:26:19 -04:00
|
|
|
hasAccessToDocument: (req, document, method=null) ->
|
|
|
|
return true if req.method is 'GET' or method is 'get' or req.user?.isAdmin()
|
|
|
|
return false
|
|
|
|
|
2014-01-03 13:32:13 -05:00
|
|
|
module.exports = new ArticleHandler()
|