2016-08-06 19:47:04 +02:00
|
|
|
// Deprecated way to handle permission in components, check CanDo component
|
2016-03-18 10:50:40 +09:00
|
|
|
|
2016-08-06 19:47:04 +02:00
|
|
|
// import React, { PropTypes, Component } from 'react';
|
|
|
|
// import Users from 'meteor/nova:users';
|
2016-02-22 13:23:46 +09:00
|
|
|
|
2016-08-06 19:47:04 +02:00
|
|
|
// const CanViewPost = ({user, post, children}) => {
|
|
|
|
// if (Users.canView(this.props.user, this.props.document)) {
|
|
|
|
// 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>;
|
|
|
|
// }
|
|
|
|
// };
|
2016-02-22 13:23:46 +09:00
|
|
|
|
2016-08-06 19:47:04 +02:00
|
|
|
// CanViewPost.propTypes = {
|
|
|
|
// user: React.PropTypes.object,
|
|
|
|
// post: React.PropTypes.object
|
|
|
|
// }
|
2016-05-22 16:42:24 +09:00
|
|
|
|
2016-08-06 19:47:04 +02:00
|
|
|
// CanViewPost.displayName = "CanViewPost";
|
|
|
|
|
|
|
|
// module.exports = CanViewPost;
|