-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
feat: Implement runtine check for enterprise features #4676
Merged
krynble
merged 10 commits into
master
from
n8n-5634-change-runtime-when-enterprise-features
Nov 22, 2022
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7998ae7
refactor: Adjust credential endpoints permissions
krynble 1ab563c
Merge branch 'master' into n8n-5633-prevent-access-to-credentials-when
krynble 4157116
fix: Types and minor changes
krynble c47ac3c
refactor: Implement runtime checks for enterprise features
krynble 68ae7de
Merge branch 'master' into n8n-5634-change-runtime-when-enterprise-fe…
krynble 3253ec9
feat: Implement runtine check for enterprise features
krynble e6bbecb
fix: correct typeorm import
krynble c6b2a3f
merge master
krynble f6e4a8a
fix: Minor code improvements
krynble 7ab074c
Merge branch 'master' into n8n-5634-change-runtime-when-enterprise-fe…
krynble File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,7 +9,7 @@ import * as Db from '@/Db'; | |||||||||||||||||||||||||||
import * as ResponseHelper from '@/ResponseHelper'; | ||||||||||||||||||||||||||||
import { PublicUser } from './Interfaces'; | ||||||||||||||||||||||||||||
import { MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH, User } from '@db/entities/User'; | ||||||||||||||||||||||||||||
import { Role } from '@db/entities/Role'; | ||||||||||||||||||||||||||||
import { Role, RoleNames, RoleScopes } from '@db/entities/Role'; | ||||||||||||||||||||||||||||
import { AuthenticatedRequest } from '@/requests'; | ||||||||||||||||||||||||||||
import config from '@/config'; | ||||||||||||||||||||||||||||
import { getWebhookBaseUrl } from '../WebhookHelpers'; | ||||||||||||||||||||||||||||
|
@@ -78,6 +78,16 @@ export async function getInstanceOwner(): Promise<User> { | |||||||||||||||||||||||||||
return owner; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
export async function getRole(scope: RoleScopes, name: RoleNames): Promise<Role> { | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also use lookup types to avoid ex/importing: |
||||||||||||||||||||||||||||
const role = await Db.collections.Role.findOneOrFail({ | ||||||||||||||||||||||||||||
where: { | ||||||||||||||||||||||||||||
name, | ||||||||||||||||||||||||||||
scope, | ||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||
return role; | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||
* Return the n8n instance base URL without trailing slash. | ||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.