const CanViewPost = ({user, post, children}) => { if (Users.can.viewPost(this.props.user, this.props.document)) { return this.props.children; } else if (!this.props.user){ return

Please log in.

; } else { return

Sorry, you do not have permissions to post at this time

; } }; CanViewPost.propTypes = { user: React.PropTypes.object, post: React.PropTypes.object } module.exports = CanViewPost;