opnform-host-nginx/client
Chirag Chhatrala 2366f9515d
Readonly User (#637)
* Readonly User

* Refactor FormPolicy and TemplatePolicy to centralize write operation logic

- Introduced a private method `canPerformWriteOperation` in both FormPolicy and TemplatePolicy to encapsulate the logic for determining if a user can perform write operations on the respective models.
- Updated the `update`, `delete`, `restore`, and `forceDelete` methods in FormPolicy to use the new method for improved readability and maintainability.
- Simplified the `update` and `delete` methods in TemplatePolicy to leverage the centralized write operation logic.

This refactoring enhances code clarity and reduces duplication across policy classes.

* Refactor user and workspace permissions handling

- Updated FormController to authorize form creation based on workspace context.
- Removed the `is_readonly` attribute from UserResource and integrated it into WorkspaceResource for better encapsulation.
- Refactored User model to eliminate the `getIsReadonlyAttribute` method, shifting readonly logic to the Workspace model.
- Adjusted FormPolicy and TemplatePolicy to utilize workspace readonly checks for user permissions.
- Updated various frontend components to reference workspace readonly status instead of user readonly status, enhancing clarity and consistency in permission handling.

These changes improve the management of user permissions in relation to workspaces, ensuring a more robust and maintainable authorization system.

* Fix isReadonlyUser

* fix pint

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-30 14:35:23 +01:00
..
components Readonly User (#637) 2024-12-30 14:35:23 +01:00
composables Add reCAPTCHA support and update captcha provider handling (#647) 2024-12-18 16:35:09 +01:00
data Improve Integration Cards (#643) 2024-12-18 13:07:19 +01:00
i18n/lang Enhance language support and fix validation messages 2024-12-09 12:47:01 +01:00
layouts 0351d front end linting (#377) 2024-04-15 19:39:03 +02:00
lib Improve Integration Cards (#643) 2024-12-18 13:07:19 +01:00
middleware Form editor v2 (#579) 2024-09-23 20:02:38 +02:00
mixins/forms 41db1 submission editor theme fix (#500) 2024-07-24 09:50:42 +02:00
pages Readonly User (#637) 2024-12-30 14:35:23 +01:00
plugins Feature flags (#543) 2024-08-27 16:49:43 +02:00
public Technical docs (#553) 2024-09-02 15:33:17 +02:00
scss Form Editor v2.5 (#599) 2024-10-23 10:34:51 +02:00
server 0351d front end linting (#377) 2024-04-15 19:39:03 +02:00
stores Form Editor v2.5 (#599) 2024-10-23 10:34:51 +02:00
.dockerignore Docker compose setup (#513) 2024-08-05 12:06:20 +02:00
.env.docker Feature flags (#543) 2024-08-27 16:49:43 +02:00
.env.example Add reCAPTCHA support and update captcha provider handling (#647) 2024-12-18 16:35:09 +01:00
.eslintrc.cjs Google Sheet - OAuth "client" powered integrations (#415) 2024-06-05 15:35:46 +02:00
.gitignore Reworked docker scripts for new nuxt infrastructure (#285) 2024-01-18 16:35:45 +01:00
README.md Work in progress 2023-12-09 15:47:03 +01:00
app.config.ts Form editor v2 (#579) 2024-09-23 20:02:38 +02:00
app.vue improve RTL mode (#625) 2024-11-21 16:14:27 +01:00
error.vue Track 500 errors in Sentry 2024-06-18 12:31:17 +02:00
gtm.js Migrate to GTM 2024-06-06 18:03:41 +02:00
nuxt.config.ts Enhance language support and fix validation messages 2024-12-09 12:47:01 +01:00
opnform.config.js Technical docs (#553) 2024-09-02 15:33:17 +02:00
package-lock.json Form Translation (#616) 2024-12-04 18:32:14 +01:00
package.json Add reCAPTCHA support and update captcha provider handling (#647) 2024-12-18 16:35:09 +01:00
runtimeConfig.js Add reCAPTCHA support and update captcha provider handling (#647) 2024-12-18 16:35:09 +01:00
sitemap.js 0351d front end linting (#377) 2024-04-15 19:39:03 +02:00
tailwind.config.js improve RTL mode (#625) 2024-11-21 16:14:27 +01:00
tsconfig.json Work in progress 2023-12-09 15:47:03 +01:00

README.md

Nuxt 3 Minimal Starter

Look at the Nuxt 3 documentation to learn more.

Setup

Make sure to install the dependencies:

# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install

Development Server

Start the development server on http://localhost:3000:

# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev

Production

Build the application for production:

# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build

Locally preview production build:

# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview

Check out the deployment documentation for more information.