chore: disable API calls for un-authorized users (#3144)

* fix: disable api calls if user doesn't have access

* chore: remove permissions from component level

* chore: rmeove console log and organize import statements
This commit is contained in:
Aaryan Khandelwal 2023-12-17 00:35:53 +05:30 committed by GitHub
parent 3d83101f69
commit 8a1a6c6f62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 139 additions and 86 deletions

View file

@ -82,9 +82,11 @@ export class IssueStore implements IIssueStore {
autorun(() => {
const workspaceSlug = this.rootStore.workspace.workspaceSlug;
const projectId = this.rootStore.project.projectId;
const hasPermissionToCurrentProject = this.rootStore.user.hasPermissionToCurrentProject;
if (
workspaceSlug &&
projectId &&
hasPermissionToCurrentProject &&
this.rootStore.issueFilter.userFilters &&
this.rootStore.issueFilter.userDisplayFilters
)
@ -108,8 +110,8 @@ export class IssueStore implements IIssueStore {
: "grouped"
: "ungrouped"
: ungroupedLayouts.includes(issueLayout)
? "ungrouped"
: null;
? "ungrouped"
: null;
return _issueState || null;
}