GithubHelp home page GithubHelp logo

cashier-server-rs's Introduction

1 Model Design

1.1 Permissions

A permission represents the ability to do one action. If a user has a role (including default role), and this role contains a permission, then we say this user has this permission.

Key Type Description
subject String the subject of the permission
action String the action of the permission
displayName String a name for display purpose
description String a more detailed explanation
createdAt Date the time to create the permission
updatedAt Date last time to update the permission
deleted Boolean whether the permission is deleted

All fields are required.

1.2 Roles

A role consists of several mutually related permissions.

Key Type Description
name String the name of the role
permissions Array<ObjectId> permissions of the role
displayName String a name for display purpose
description String a more detailed explanation
createdAt Date the time to create the role
updatedAt Date last time to update the role
deleted Boolean whether the role is deleted

All fields are required.

1.3 Users

Key Type Description Required Public
username String the username of the user true true
password String the password of the user true false
roles Array<ObjectId> the roles of the user true false
email String the email of the user false false
nickname String the nickname of the user false true
avatar String path to the avatar false true
avatar128 String path to a square 128x128 avatar false true
blocked Boolean whether the user is blocked false false
createdAt Date the time to create the user true true
updatedAt Date last time to update the user true false
deleted Boolean whether the user is deleted true false

User's public information can be accessed via /api/v1/users/public. password is never accessible.

username and email should be unique.

1.4 Tokens

Key Type Description
user ObjectId user who owns the token
issuedAt Date the time to create the token
expiresAt Date the time when the token expires
acquireMethod String method to acquire the token
invoked bool whether jwt is invoked

All fields are required.

1.5 Global Settings

There should exists one single document in globalSettings document.

Key Type Description
jwtSecret Binary 256-byte random secret for JWT
createdAt Date the time to create the global settings
updatedAt Date last time to update the global settings

All fields are required.

cashier-server-rs's People

Contributors

sunziping2016 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.