mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
19 lines
No EOL
394 B
JavaScript
19 lines
No EOL
394 B
JavaScript
const CanCreatePost = React.createClass({
|
|
|
|
propTypes: {
|
|
user: React.PropTypes.object
|
|
},
|
|
|
|
render() {
|
|
if (Users.can.post(this.props.user)) {
|
|
return this.props.children;
|
|
} else if (!this.props.user){
|
|
return <p>Please log in.</p>;
|
|
} else {
|
|
return <p>Sorry, you do not have permissions to post at this time</p>;
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
module.exports = CanCreatePost; |