Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Better access rights info from the global user context object #36646

Closed
1 task done
suavdebird opened this issue Oct 2, 2024 · 4 comments
Closed
1 task done
Assignees
Labels
Enhancement New feature or request Framework Functions Cases related to internal functions like showAlert(), navigateTo() etc... Javascript Product Issues related to users writing javascript in appsmith Query & JS Pod Issues related to the query & JS Pod

Comments

@suavdebird
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Summary

Add appName and workspaceName to the properties in the appsmith global object.

Why should this be worked on?

This will allow to cross reference the roles you're in with the name of the workspace to verify whether you have the necessary e.g. "Admin - ${workspaceName}".

@suavdebird suavdebird added the Enhancement New feature or request label Oct 2, 2024
@Nikhil-Nandagopal
Copy link
Contributor

@suavdebird Could you tell us a bit about what you are trying to achieve with this information?

@Nikhil-Nandagopal Nikhil-Nandagopal added the Needs More Info Needs additional information label Oct 7, 2024
@suavdebird
Copy link
Author

suavdebird commented Oct 7, 2024

@Nikhil-Nandagopal

Background

Hi, in our infrastructure it makes sense to have one instance of appSmith that manages multiple environments. This is to simplify the instance management (upgrades, backups, user&groups management, etc..) . Each of our environments (prod, stage, test) are represented by workspaces.

Use Case 1

Some functionalities need to be controlled per workspace, so we create roles following the default app smith naming convention ( - , e.g. "Super User - Prod"). Now depending if you do have the Super User rights in a particular workspace or not, we should show a button there or not. The only way to achieve that is to check the role name, but to do that we need the name of the current workspace since the you may have different rights per workspace.

Usecase 2

Currently there's no way to tell which workspace am I using at the moment. If we had workspace in the global object we could simply display it at the top of the page.

Alternative to Usecase 1

this particular usecase could also be satisfied if there was a programatic call to see if the current user has the right to execute a specific data source, which doesn't seem to be possible by any way other than trying to use it.

I hope this helps. Thanks!

@Nikhil-Nandagopal Nikhil-Nandagopal added Framework Functions Cases related to internal functions like showAlert(), navigateTo() etc... and removed Needs More Info Needs additional information labels Oct 7, 2024
@Nikhil-Nandagopal
Copy link
Contributor

@suavdebird thank you for the information!

@github-actions github-actions bot added Javascript Product Issues related to users writing javascript in appsmith Query & JS Pod Issues related to the query & JS Pod labels Oct 7, 2024
@Nikhil-Nandagopal
Copy link
Contributor

I'm going to close this in favor of #26610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Framework Functions Cases related to internal functions like showAlert(), navigateTo() etc... Javascript Product Issues related to users writing javascript in appsmith Query & JS Pod Issues related to the query & JS Pod
Projects
None yet
Development

No branches or pull requests

4 participants