README
LSK.js – auth
@lskjs/auth – LSK.js – auth – module for authorization by login and password and singup through social networks
Table of contents
- ⌨️ Install
- достал из chat.server.js
- 📖 License
- 👥 Contributors
- 👏 Contributing
- 📮 Any questions? Always welcome :)
⌨️ Install
# yarn
yarn i @lskjs/auth @lskjs/db @lskjs/mobx @lskjs/server-api axios bluebird js-cookie lodash mobx
# npm
npm i @lskjs/auth @lskjs/db @lskjs/mobx @lskjs/server-api axios bluebird js-cookie lodash mobx
достал из chat.server.js
Message.getRole(userId) -> owner
Message.is('owner') // ?
Message.roles = {
owner: {
read: ['title', 'createdAt'], // all
write: ['user, 'owner'] // info
}
guest: {
read: ['title', 'createdAt'], // all
write: ['user, 'owner'] // null
}
validate params
1) OWNER
2) Public
Message.isOwner = (userId) => { this.ownerId } ['content']
Message.canWrite = ['content']
MEssage.canWrite = ['content']
schema = {
title: {
canWrite: () => {}
}
}
📖 License
This project is licensed under the MIT License - see the LICENSE file for details
👥 Contributors
Igor Suvorov 💻 🎨 🤔 |
👏 Contributing
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b features/fooBar
) - Commit your changes (
git commit -am 'feat(image): Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request