import React, { PropTypes, Component } from 'react'; const CanCreatePost = (props, context) => { const currentUser = context.currentUser; const children = props.children; const AccountsForm = Telescope.components.AccountsForm; if (!currentUser){ return (

Please Log In

) } else if (Users.can.post(currentUser)) { return children; } else { return

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

; } }; CanCreatePost.contextTypes = { currentUser: React.PropTypes.object }; module.exports = CanCreatePost;