Gravity
  • Welcome to Gravity
  • Getting Started
  • Stack
  • Updates
  • Rules For AI
  • Troubleshooting
  • Gravity Server
    • Introduction
    • Installation
      • Install Node.js
      • Database Setup
      • Stripe Setup
      • Mailgun Setup
      • Install Gravity
    • Application Structure
    • REST API
      • API Scopes
      • Webhooks
    • Authentication
      • Email Verification
      • Social Sign On
      • Two-Factor Authentication
    • Authorization
      • Feature Access and Plan Restrictions
      • Permissions (Roles)
    • Config
    • Environment Variables
    • Database Queries
    • Handling Errors
    • Logging
    • Localization
    • Push Notifications
    • Email Notifications
    • User Feedback
    • User Onboarding
    • File Uploads
    • Billing
      • Seat Billing
      • Usage Billing
    • Free Accounts
    • CLI Toolbelt
    • Testing
    • AI Tools
    • Background Jobs
    • Deployment
  • Gravity Web
    • Introduction
    • Tailwind & SCSS
    • Routing
    • Events
    • Authentication
    • Localization
    • Hooks
      • useAPI
      • usePlans
      • usePermissions
    • Components
      • Alert
      • Animate
      • Avatar
      • Badge
      • Breadcrumb
      • Button
      • Calendar
      • Card
      • Chart
      • Checklist
      • Credit Card
      • Detail
      • Dialog
      • Dropdown
      • Feedback
      • Form
      • Grid
      • Header
      • Helper
      • Icon
      • Image
      • Layout
      • Link
      • List
      • Loader
      • Logo
      • Nav
      • Onboarding
      • Pagination
      • Popover
      • Progress
      • Row
      • Search
      • Separator
      • Sheet
      • Social
      • Stat
      • Table
      • Tabs
      • Toast (Notification)
      • Tooltip
      • User
      • View
    • Views
    • Handling Errors
    • Deployment
  • Gravity Native
    • Introduction
    • Prerequisites
    • Installation
    • App Context
    • Authentication
    • Localisation
    • External Linking
    • Handling Errors
    • Navigation
    • Config
    • Events
    • Views
    • Components
      • Badge
      • Blankslate
      • Button
      • Card
      • Chart
      • Form
      • Global
      • Grid
      • Icon
      • List
      • Logo
      • Message
      • Modal
      • Nav
      • Notification
      • Progress Bar
      • Search
      • Separator
      • Social
      • Stat
      • View
    • Push Notifications
    • Payments
    • Building Your App
  • Mission Control
    • Introduction
    • Installation
    • User Management
    • Feedback
    • Events
    • Logs
  • Website Template
    • Introduction
    • Environment Variables
    • Styling
    • Components
      • Article
      • Feature List
      • Footer
      • Hero
      • Layout
      • Pricing
      • Meta Data
      • Nav
      • Testimonial
    • Build and Deploy
Powered by GitBook
On this page
  • Default Permissions
  • Client Permissions
  • How Permissions Work
  • What Each Permission Can Do
  • Master
  • Owner
  • Admin
  • User
  • Developer

Was this helpful?

  1. Gravity Server
  2. Authorization

Permissions (Roles)

PreviousFeature Access and Plan RestrictionsNextConfig

Last updated 1 year ago

Was this helpful?

User permission levels are defined in inside the permissions object. Here you can define a multi-level tier of user access levels.

Default Permissions

Out-of-the-box, Gravity includes master (for ), owner, admin, user and developer roles.

Client Permissions

The same permission object is included inside client/src/permissions.json. You must use both files, as the React client runs independently to the server. You can also define different permissions for the client UI if you need to.

How Permissions Work

The permission is stored in the JWT, so you can verify user actions at the API level based on this permission.

The permission level is also stored in the UI context, so you can show or hide features depending on the user's permission level.

You should only use the permission stored in the client context for visceral purposes and ALWAYS use the API to control access. Savvy users can modify this permission and reveal hidden UI features. Using the API will prohibit them from performing an action they do not have permission to do.

What Each Permission Can Do

Below is a breakdown of what each user permission can do by default. You can customise this logic to suit your own requirements.

Each account can only have one owner but as many admins, users and developers as you need.

Master

  • view all accounts and all users

  • edit any account and any user

  • view application logs

  • view user feedback

Owner

  • can edit billing details

  • can close the account

  • can invite admins, users and developers

  • can promote a user to admin

  • can demote an admin to user

  • can edit admins, users and developers

  • can create, update and delete API keys

Admin

  • can invite users

  • can edit users

  • can promote a user to admin

User

  • can view/edit/delete data that they are permitted to

Developer

  • everything a user can do plus update and delete API keys

/config
Mission Control