ToolJet/server/test/controllers/data_queries.e2e-spec.ts

594 lines
21 KiB
TypeScript
Raw Normal View History

2021-07-24 06:13:21 +00:00
import * as request from 'supertest';
import { INestApplication } from '@nestjs/common';
import {
clearDB,
createUser,
createNestAppInstance,
createDataQuery,
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
createAppGroupPermission,
generateAppDefaults,
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
authenticateUser,
} from '../test.helper';
import { getManager, getRepository } from 'typeorm';
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
import { GroupPermission } from 'src/entities/group_permission.entity';
import { AppGroupPermission } from 'src/entities/app_group_permission.entity';
2021-07-24 06:13:21 +00:00
describe('data queries controller', () => {
let app: INestApplication;
beforeEach(async () => {
await clearDB();
});
beforeAll(async () => {
app = await createNestAppInstance();
});
2021-07-24 18:09:25 +00:00
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
it('should be able to update queries of an app only if group is admin or group has app update permission', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
const developerUserData = await createUser(app, {
email: 'developer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
loggedUser = await authenticateUser(app, developerUserData.user.email);
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'viewer'],
organization: adminUserData.organization,
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
loggedUser = await authenticateUser(app, viewerUserData.user.email);
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const anotherOrgAdminUserData = await createUser(app, {
email: 'another@tooljet.io',
groups: ['all_users', 'admin'],
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
loggedUser = await authenticateUser(app, anotherOrgAdminUserData.user.email);
anotherOrgAdminUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const { application, dataQuery } = await generateAppDefaults(app, adminUserData.user, {});
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
// setup app permissions for developer
const developerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'developer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, developerUserGroup.id, {
read: true,
update: true,
delete: false,
});
// setup app permissions for viewer
const viewerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'viewer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, viewerUserGroup.id, {
read: true,
update: false,
delete: false,
});
2021-07-24 18:09:25 +00:00
for (const userData of [adminUserData, developerUserData]) {
const newOptions = { method: userData.user.email };
2021-07-24 18:09:25 +00:00
const response = await request(app.getHttpServer())
.patch(`/api/data_queries/${dataQuery.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
2021-07-24 18:09:25 +00:00
.send({
options: newOptions,
});
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(200);
await dataQuery.reload();
expect(dataQuery.options.method).toBe(newOptions.method);
}
// Should not update if viewer or if user of another org
for (const userData of [anotherOrgAdminUserData, viewerUserData]) {
2021-07-24 18:09:25 +00:00
const oldOptions = dataQuery.options;
const response = await request(app.getHttpServer())
.patch(`/api/data_queries/${dataQuery.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
2021-07-24 18:09:25 +00:00
.send({
options: { method: '' },
});
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(403);
await dataQuery.reload();
expect(dataQuery.options.method).toBe(oldOptions.method);
}
});
it('should be able to delete queries of an app only if admin/developer of same organization', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'admin'],
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
const developerUserData = await createUser(app, {
email: 'developer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'viewer'],
organization: adminUserData.organization,
});
const anotherOrgAdminUserData = await createUser(app, {
email: 'another@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'admin'],
});
[Feature] :: Global datasources (#5504) * add: columns and migrations for data queries and sources * add: migrations for app environments * fix: datasources and queries api * fix: import apis * add: radixui colors * create: global datasource page * fix: version creation not including global datasources queries * fix: version deletion failure * fix: ui and other bugs * add: check for abilities on global ds * fix: bugs * fix: existing test cases * fix: migration and bugs * fix: rest api oauthorize bugs * hide: add button for local ds * fix: query bugs * fix: new organization environment creation * fix: local ds label showing for new apps * fix: on page load queries for preview app and published app * fix: import bugs from v1 * fix: merge conflicts * fix: import apis * fix: apss with mulit envs * fix: ui bugs * fix: environments not being created on db:seed * fix: ui bugs * fix: route settings for global datasources * fix: customer dashboard template * fix: local ds queries not being saved * fix: runpy issues * changes: ui * fix: migration issues * fix: ui * hide datasources when no local datasources * fix: test cases * fix: unit test cases and global queries on app import/export * cleanup * add: package-lock file * undo: migration rename * cleanup * fix: ui bugs * migration fixes * fix: dark mode issues * fix: change datasource failing on query create mode * fix: workspace selector issues * fix: clickoutside for change scope option * migration changes * fix: open api issue * reverting configs changes * [Fix] Global datasources & Environment Id issue (#5830) * fix: oauth env id issue * code changes --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2023-03-24 16:11:21 +00:00
const { application, dataSource, appVersion } = await generateAppDefaults(app, adminUserData.user, {
isQueryNeeded: false,
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
loggedUser = await authenticateUser(app, developerUserData.user.email);
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, viewerUserData.user.email);
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, anotherOrgAdminUserData.user.email);
anotherOrgAdminUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
// setup app permissions for developer
const developerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'developer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, developerUserGroup.id, {
read: true,
update: true,
delete: false,
});
for (const userData of [adminUserData, developerUserData]) {
const dataQuery = await createDataQuery(app, {
dataSource,
[Feature] :: Global datasources (#5504) * add: columns and migrations for data queries and sources * add: migrations for app environments * fix: datasources and queries api * fix: import apis * add: radixui colors * create: global datasource page * fix: version creation not including global datasources queries * fix: version deletion failure * fix: ui and other bugs * add: check for abilities on global ds * fix: bugs * fix: existing test cases * fix: migration and bugs * fix: rest api oauthorize bugs * hide: add button for local ds * fix: query bugs * fix: new organization environment creation * fix: local ds label showing for new apps * fix: on page load queries for preview app and published app * fix: import bugs from v1 * fix: merge conflicts * fix: import apis * fix: apss with mulit envs * fix: ui bugs * fix: environments not being created on db:seed * fix: ui bugs * fix: route settings for global datasources * fix: customer dashboard template * fix: local ds queries not being saved * fix: runpy issues * changes: ui * fix: migration issues * fix: ui * hide datasources when no local datasources * fix: test cases * fix: unit test cases and global queries on app import/export * cleanup * add: package-lock file * undo: migration rename * cleanup * fix: ui bugs * migration fixes * fix: dark mode issues * fix: change datasource failing on query create mode * fix: workspace selector issues * fix: clickoutside for change scope option * migration changes * fix: open api issue * reverting configs changes * [Fix] Global datasources & Environment Id issue (#5830) * fix: oauth env id issue * code changes --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2023-03-24 16:11:21 +00:00
appVersion,
options: {
method: 'get',
url: 'https://api.github.com/repos/tooljet/tooljet/stargazers',
url_params: [],
headers: [],
body: [],
},
});
const newOptions = { method: userData.user.email };
const response = await request(app.getHttpServer())
.delete(`/api/data_queries/${dataQuery.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
.send({
options: newOptions,
});
expect(response.statusCode).toBe(200);
}
// Should not update if viewer or if user of another org
for (const userData of [anotherOrgAdminUserData, viewerUserData]) {
const dataQuery = await createDataQuery(app, {
dataSource,
[Feature] :: Global datasources (#5504) * add: columns and migrations for data queries and sources * add: migrations for app environments * fix: datasources and queries api * fix: import apis * add: radixui colors * create: global datasource page * fix: version creation not including global datasources queries * fix: version deletion failure * fix: ui and other bugs * add: check for abilities on global ds * fix: bugs * fix: existing test cases * fix: migration and bugs * fix: rest api oauthorize bugs * hide: add button for local ds * fix: query bugs * fix: new organization environment creation * fix: local ds label showing for new apps * fix: on page load queries for preview app and published app * fix: import bugs from v1 * fix: merge conflicts * fix: import apis * fix: apss with mulit envs * fix: ui bugs * fix: environments not being created on db:seed * fix: ui bugs * fix: route settings for global datasources * fix: customer dashboard template * fix: local ds queries not being saved * fix: runpy issues * changes: ui * fix: migration issues * fix: ui * hide datasources when no local datasources * fix: test cases * fix: unit test cases and global queries on app import/export * cleanup * add: package-lock file * undo: migration rename * cleanup * fix: ui bugs * migration fixes * fix: dark mode issues * fix: change datasource failing on query create mode * fix: workspace selector issues * fix: clickoutside for change scope option * migration changes * fix: open api issue * reverting configs changes * [Fix] Global datasources & Environment Id issue (#5830) * fix: oauth env id issue * code changes --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2023-03-24 16:11:21 +00:00
appVersion,
options: {
method: 'get',
url: 'https://api.github.com/repos/tooljet/tooljet/stargazers',
url_params: [],
headers: [],
body: [],
},
});
const oldOptions = dataQuery.options;
const response = await request(app.getHttpServer())
.delete(`/api/data_queries/${dataQuery.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
.send({
options: { method: '' },
});
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(403);
await dataQuery.reload();
expect(dataQuery.options.method).toBe(oldOptions.method);
}
2021-07-24 18:09:25 +00:00
});
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
it('should be able to get queries only if the user has app read permission and belongs to the same organization', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const developerUserData = await createUser(app, {
email: 'developer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'viewer'],
organization: adminUserData.organization,
});
const { application, dataSource, appVersion } = await generateAppDefaults(app, adminUserData.user, {
isQueryNeeded: false,
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, developerUserData.user.email);
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, viewerUserData.user.email);
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const anotherOrgAdminUserData = await createUser(app, {
email: 'another@tooljet.io',
groups: ['all_users', 'admin'],
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
loggedUser = await authenticateUser(app, anotherOrgAdminUserData.user.email);
anotherOrgAdminUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const allUserGroup = await getManager().findOneOrFail(GroupPermission, {
where: { group: 'all_users', organization: adminUserData.organization },
});
await getManager().update(
AppGroupPermission,
{ app: application, groupPermissionId: allUserGroup },
{ read: true }
);
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
// setup app permissions for developer
const developerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'developer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, developerUserGroup.id, {
read: true,
update: true,
delete: false,
});
2021-07-24 18:09:25 +00:00
await createDataQuery(app, {
dataSource,
[Feature] :: Global datasources (#5504) * add: columns and migrations for data queries and sources * add: migrations for app environments * fix: datasources and queries api * fix: import apis * add: radixui colors * create: global datasource page * fix: version creation not including global datasources queries * fix: version deletion failure * fix: ui and other bugs * add: check for abilities on global ds * fix: bugs * fix: existing test cases * fix: migration and bugs * fix: rest api oauthorize bugs * hide: add button for local ds * fix: query bugs * fix: new organization environment creation * fix: local ds label showing for new apps * fix: on page load queries for preview app and published app * fix: import bugs from v1 * fix: merge conflicts * fix: import apis * fix: apss with mulit envs * fix: ui bugs * fix: environments not being created on db:seed * fix: ui bugs * fix: route settings for global datasources * fix: customer dashboard template * fix: local ds queries not being saved * fix: runpy issues * changes: ui * fix: migration issues * fix: ui * hide datasources when no local datasources * fix: test cases * fix: unit test cases and global queries on app import/export * cleanup * add: package-lock file * undo: migration rename * cleanup * fix: ui bugs * migration fixes * fix: dark mode issues * fix: change datasource failing on query create mode * fix: workspace selector issues * fix: clickoutside for change scope option * migration changes * fix: open api issue * reverting configs changes * [Fix] Global datasources & Environment Id issue (#5830) * fix: oauth env id issue * code changes --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2023-03-24 16:11:21 +00:00
appVersion,
2021-07-24 18:09:25 +00:00
kind: 'restapi',
options: { method: 'get' },
2021-07-24 18:09:25 +00:00
});
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
for (const userData of [adminUserData, developerUserData]) {
2021-07-24 18:09:25 +00:00
const response = await request(app.getHttpServer())
.get(`/api/data_queries?app_version_id=${appVersion.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie']);
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(200);
expect(response.body.data_queries.length).toBe(1);
}
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
let response = await request(app.getHttpServer())
.get(`/api/data_queries?app_version_id=${appVersion.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', viewerUserData.user.defaultOrganizationId)
.set('Cookie', viewerUserData['tokenCookie']);
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
expect(response.statusCode).toBe(200);
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
2021-07-24 18:09:25 +00:00
// Forbidden if user of another organization
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
response = await request(app.getHttpServer())
.get(`/api/data_queries?app_version_id=${appVersion.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', anotherOrgAdminUserData.user.defaultOrganizationId)
.set('Cookie', anotherOrgAdminUserData['tokenCookie']);
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(403);
2021-07-24 18:09:25 +00:00
});
it('should be able to search queries with application version id', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const { dataSource, appVersion } = await generateAppDefaults(app, adminUserData.user, {
isQueryNeeded: false,
});
await createDataQuery(app, {
dataSource,
[Feature] :: Global datasources (#5504) * add: columns and migrations for data queries and sources * add: migrations for app environments * fix: datasources and queries api * fix: import apis * add: radixui colors * create: global datasource page * fix: version creation not including global datasources queries * fix: version deletion failure * fix: ui and other bugs * add: check for abilities on global ds * fix: bugs * fix: existing test cases * fix: migration and bugs * fix: rest api oauthorize bugs * hide: add button for local ds * fix: query bugs * fix: new organization environment creation * fix: local ds label showing for new apps * fix: on page load queries for preview app and published app * fix: import bugs from v1 * fix: merge conflicts * fix: import apis * fix: apss with mulit envs * fix: ui bugs * fix: environments not being created on db:seed * fix: ui bugs * fix: route settings for global datasources * fix: customer dashboard template * fix: local ds queries not being saved * fix: runpy issues * changes: ui * fix: migration issues * fix: ui * hide datasources when no local datasources * fix: test cases * fix: unit test cases and global queries on app import/export * cleanup * add: package-lock file * undo: migration rename * cleanup * fix: ui bugs * migration fixes * fix: dark mode issues * fix: change datasource failing on query create mode * fix: workspace selector issues * fix: clickoutside for change scope option * migration changes * fix: open api issue * reverting configs changes * [Fix] Global datasources & Environment Id issue (#5830) * fix: oauth env id issue * code changes --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2023-03-24 16:11:21 +00:00
appVersion,
kind: 'restapi',
options: { method: 'get' },
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
const loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
let response = await request(app.getHttpServer())
.get(`/api/data_queries?app_version_id=${appVersion.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
.set('Cookie', adminUserData['tokenCookie']);
expect(response.statusCode).toBe(200);
expect(response.body.data_queries.length).toBe(1);
response = await request(app.getHttpServer())
.get(`/api/data_queries?app_version_id=62929ad6-11ae-4655-bb3e-2d2465b58950`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
.set('Cookie', adminUserData['tokenCookie']);
expect(response.statusCode).toBe(500);
});
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
it('should be able to create queries for an app only if the user has admin group or update permission', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const developerUserData = await createUser(app, {
email: 'developer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'viewer'],
organization: adminUserData.organization,
});
const {
application,
dataSource,
appVersion: applicationVersion,
} = await generateAppDefaults(app, adminUserData.user, {
isQueryNeeded: false,
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
const anotherOrgAdminUserData = await createUser(app, {
email: 'another@tooljet.io',
groups: ['all_users', 'admin'],
});
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, developerUserData.user.email);
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, viewerUserData.user.email);
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, anotherOrgAdminUserData.user.email);
anotherOrgAdminUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
// setup app permissions for developer
const developerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'developer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, developerUserGroup.id, {
read: true,
update: true,
delete: false,
});
2021-07-24 18:09:25 +00:00
const requestBody = {
name: 'get query',
data_source_id: dataSource.id,
2021-07-24 18:09:25 +00:00
kind: 'restapi',
options: { method: 'get' },
app_version_id: applicationVersion.id,
};
2021-07-24 18:09:25 +00:00
for (const userData of [adminUserData, developerUserData]) {
2021-07-24 18:09:25 +00:00
const response = await request(app.getHttpServer())
.post(`/api/data_queries`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
.send(requestBody);
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(201);
expect(response.body.id).toBeDefined();
expect(response.body.data_source_id).toBe(dataSource.id);
expect(response.body.options).toBeDefined();
expect(response.body.created_at).toBeDefined();
expect(response.body.updated_at).toBeDefined();
2021-07-24 18:09:25 +00:00
}
// Forbidden if a viewer or a user of another organization
for (const userData of [anotherOrgAdminUserData, viewerUserData]) {
2021-07-24 18:09:25 +00:00
const response = await request(app.getHttpServer())
.post(`/api/data_queries`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie'])
.send(requestBody);
2021-07-24 18:09:25 +00:00
expect(response.statusCode).toBe(403);
}
});
it('should be able to get queries sorted created wise', async () => {
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const { dataSource, appVersion } = await generateAppDefaults(app, adminUserData.user, {
isQueryNeeded: false,
});
const options = {
method: 'get',
url: null,
url_params: [['', '']],
headers: [['', '']],
body: [['', '']],
json_body: null,
body_toggle: false,
};
const createdQueries = [];
const totalQueries = 15;
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
const loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
for (let i = 1; i <= totalQueries; i++) {
const queryParams = {
name: `restapi${i}`,
data_source_id: dataSource.id,
kind: 'restapi',
options,
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
plugin_id: null,
app_version_id: appVersion.id,
};
const response = await request(app.getHttpServer())
.post(`/api/data_queries`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
.set('Cookie', adminUserData['tokenCookie'])
.send(queryParams);
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
response.body['plugin'] = null;
createdQueries.push(response.body);
}
// Latest query should be on top
createdQueries.reverse();
const response = await request(app.getHttpServer())
.get(`/api/data_queries?app_version_id=${appVersion.id}`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', adminUserData.user.defaultOrganizationId)
.set('Cookie', adminUserData['tokenCookie']);
expect(response.statusCode).toBe(200);
expect(response.body.data_queries.length).toBe(totalQueries);
for (let i = 0; i < totalQueries; i++) {
const responseObject = response.body.data_queries[i];
const createdObject = createdQueries[i];
expect(responseObject.id).toEqual(createdObject.id);
expect(responseObject.name).toEqual(createdObject.name);
expect(responseObject.options).toMatchObject(createdObject.options);
expect(responseObject.created_at).toEqual(createdObject.created_at);
expect(responseObject.updated_at).toEqual(createdObject.updated_at);
}
});
2021-07-24 06:13:21 +00:00
it('should be able to run queries of an app if the user belongs to the same organization', async () => {
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const developerUserData = await createUser(app, {
email: 'developer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'developer'],
organization: adminUserData.organization,
});
const viewerUserData = await createUser(app, {
email: 'viewer@tooljet.io',
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
groups: ['all_users', 'viewer'],
organization: adminUserData.organization,
});
2021-07-24 06:13:21 +00:00
const { application, dataQuery } = await generateAppDefaults(app, adminUserData.user, {});
2021-07-24 06:13:21 +00:00
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
let loggedUser = await authenticateUser(app, adminUserData.user.email);
adminUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, developerUserData.user.email);
developerUserData['tokenCookie'] = loggedUser.tokenCookie;
loggedUser = await authenticateUser(app, viewerUserData.user.email);
viewerUserData['tokenCookie'] = loggedUser.tokenCookie;
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
// setup app permissions for developer
const developerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'developer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, developerUserGroup.id, {
read: true,
update: true,
delete: false,
});
// setup app permissions for viewer
const viewerUserGroup = await getRepository(GroupPermission).findOneOrFail({
where: {
group: 'viewer',
},
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
});
await createAppGroupPermission(app, application, viewerUserGroup.id, {
read: true,
update: false,
delete: false,
});
for (const userData of [adminUserData, developerUserData, viewerUserData]) {
2021-07-24 06:13:21 +00:00
const response = await request(app.getHttpServer())
.post(`/api/data_queries/${dataQuery.id}/run`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', userData.user.defaultOrganizationId)
.set('Cookie', userData['tokenCookie']);
2021-07-24 06:13:21 +00:00
expect(response.statusCode).toBe(201);
expect(response.body.data.length).toBe(30);
}
});
it('should not be able to run queries of an app if the user belongs to another organization', async () => {
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const anotherOrgAdminUserData = await createUser(app, {
email: 'another@tooljet.io',
groups: ['all_users', 'admin'],
});
2021-07-24 06:13:21 +00:00
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
const loggedUser = await authenticateUser(app, anotherOrgAdminUserData.user.email);
anotherOrgAdminUserData['tokenCookie'] = loggedUser.tokenCookie;
const { dataQuery } = await generateAppDefaults(app, adminUserData.user, {});
2021-07-24 06:13:21 +00:00
const response = await request(app.getHttpServer())
.post(`/api/data_queries/${dataQuery.id}/run`)
[Improvement] URLs scoped with workspace id (#5487) * add: new URL prefix * fix: working on home page * add: profile path * playing with rxjs * removed context part * working on path changes * changing routes - TODO: replace the workspaceId with actual id * redo: public apps path * initial commit * added authorize API * remove privileges from auth response * fixed some api issue - added subscriptions * fix: redirect url workspace-id null issue * fix: switch workspace * fix: organization list mapping - menu item paths * fix: preview url - editor, viewer permission mapping * jwt fix * fix: some url issue - permission mappings - workspace login * fixed some issues - user invite workspace-id - org settings menu item default selected item issue * app viewer fixes * fixing workspace login issues * fix * fixing issues - tooljet db - path issues - refatoring the code * fix: workspace vars permissions * fix: multi-page handle * fix: create app from template * fix: bulk user upload * fix: import app - clone app - upload profile image * fix: onboarding * fix: log out * fixed multi-workspace logout issue * fix: launch btn * fix: oauth2 * fixes * fix: sso login * fix: workspace sso login * fixing sso issues * fix: moved list of orgs to rxjs - fixed switching issues * reverting some changes * fixed some minor bugs * fixing sso redirect url issues * fix: switching network timing issues * fix: back to workspace-id * fix: tj-database - refactored the code - removed org id from some pages - will get the org id from the service file only * fix: multi-pages * fix: infinite loop issue * fixing workspace switching issue * fixes - comment link - logout & private route redirect url * fix: wrong uuid error * fixing subpath - fixed most of the places - need to test & fix workspace login, sso, new account * fix: subpath workspace login * fix: rxjs handle bug * Revert "fix: tj-database" This reverts commit 9632ec2ff0707c9d7b1777f64afbe15679203ca1. * fix: reverted tj-db changes * fix: subpath sso * typo fix * fix: existing session issues * new: switch workspace page * fix: modal dark-mode * added default sso support * fixes - subpath workspace switching - handle wrong routes * fix: manager user button - refactored the code * removed SINGLE Workspace feature * rebase * add: change modal text * fix: added validation * fixed private app 401 issue * initial commit * fix: logged out session multi-tab issue * refactoring the code * fix: redirect url issue * added auth-token in cookies * Fix: failing e2e specs * added session API * fix: backend session guard * fix: removing user details from local storage * fix: null wid * undo and redo * fix: login page * fix: viewer login redirection * fix: login page redirection * fix: public apps logout issue * added session storage and scheduler * added profile api * fix: sso login - switch workspace - login page - setup admin * working on fixes * fix: socket issue * fix: setup admin api * connected profile & logout apis * fix: malfunctioned auth token case * fix: realtime avatar * fix: profile avatar * fix: Realtime cursors avatar * setting max age for auth token cookie * add: Go to login page if logout api returns 401 * fix: subpath login * fix * fix: app logout [viewer] * fix: authorize page * remove expiry from jwt * fix: integrations route - session api * small fix * fix: updated profile * fix: workspace login [logged user] * fix: oauth and another workspace page issue * fixed app preview logout issue * subpath fix * fix: subpath app id * fix: selected state didnt change for apps page [subpath] * fix * add cookie parser to test app * specs added * increased user session expiry time * test: session & new apis * working on test cases * fix: onboarding issue * fixing specs * fix: test cases * fix: removing profile api calls * some fixes * fixing rebase issues * fix: global ds issues * fix: app is crashing * fix: back to text * fix: oauth test cases * fix: test-helper * fix: onboarding test cases * fix: tests again * refactoring the code * latest develop merging precautions - fixed a minor null issue * fix: typo * fix :menu issues due to the merging * fix: - clicking on tooljet logo didnt redirect to login page for public apps - private app preview doesnt load after login * subpath fixes * fixed back to issue * PR changes * fix: spec fixes for EE * doc: URL scoped for workspace --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com> Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 11:12:58 +00:00
.set('tj-workspace-id', anotherOrgAdminUserData.user.defaultOrganizationId)
.set('Cookie', anotherOrgAdminUserData['tokenCookie']);
2021-07-24 06:13:21 +00:00
expect(response.statusCode).toBe(403);
});
it('should be able to run queries of an app if a public app ( even if an unauthenticated user )', async () => {
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const { dataQuery } = await generateAppDefaults(app, adminUserData.user, { isAppPublic: true });
2021-07-24 06:13:21 +00:00
const response = await request(app.getHttpServer()).post(`/api/data_queries/${dataQuery.id}/run`);
2021-07-24 06:13:21 +00:00
expect(response.statusCode).toBe(201);
expect(response.body.data.length).toBe(30);
});
it('should not be able to run queries if app not not public and user is not authenticated', async () => {
Feature: User access management 🔥 (#918) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * Feature: User access permission group usage (#883) * create migrations for group permissions setup * define new entities and relationships * revise migrations * rename columns * add migration to populate permission groups for existing users * revise migrations * hide roles usage * setup group permissions for apps and users * fix defaultChecked * fix update permission checkbox * fix casl ability check to have params passed * fix casl apps abilities to check with app specific permission * add ability to delete groups * conditionally render edit and delete options for all and admin users * fix user role to group migration * revise group management pages to disallow updating default group * move manage users and groups to navbar dropdown * show only addable apps and users on dropdowns * rename header as profile settings * scope addable apps and users by organization * scope viewable apps on homepage * hide manage groups link from non admins * make permissions to be used with radio input * add loading state for add apps/users buttons * revise unit tests * revise migrations * fix e2e tests * comment out dead code * fix seeds script * handle folder count * captalize error toast * hide manage users dropdown for non admins * show fobidden error on blank homepage * fix folder app count * fix invalid state set * make group name clickable for edit instead * users with edit permission can deploy apps * not show edit link on homepage if user dont have update permission * remove unused entity from merge * remove roles usage from manage org users page * fix folder count and blank slate on homepage * disable add buttons if there is no selections * humanize default groups on view * make app added onto groups have read permission by default * not show app menu if user is not admin * remove admin users from group user addition dropdown * create default permissions for app cloned * fix querying index page without page params * fix admin scoped out from group add * remove apps from header * fix invitation url not shown * scope admin deletion check by org * scope public apps by organization * add specs for group permissions e2e * removed unused entity and add group permissions spec * remove console logs * remove unused permission * scope public app count by org * remove console log * refactor manage group permission resources component * update group permssion in org scope
2021-10-11 15:15:58 +00:00
const adminUserData = await createUser(app, {
email: 'admin@tooljet.io',
groups: ['all_users', 'admin'],
});
const { dataQuery } = await generateAppDefaults(app, adminUserData.user, {});
2021-07-24 06:13:21 +00:00
const response = await request(app.getHttpServer()).post(`/api/data_queries/${dataQuery.id}/run`);
2021-07-24 06:13:21 +00:00
expect(response.statusCode).toBe(401);
});
afterAll(async () => {
await app.close();
});
});