feat: Implement runtine check for enterprise features (no-changelog) (#4676)

* feat: Implement runtine check for enterprise features
This commit is contained in:
Omar Ajoue
2022-11-22 14:24:29 +01:00
committed by GitHub
parent 78119c9f22
commit 7b00d6e731
2 changed files with 28 additions and 10 deletions

View File

@@ -78,6 +78,15 @@ export async function getInstanceOwner(): Promise<User> {
return owner;
}
export async function getRole(scope: Role['scope'], name: Role['name']): Promise<Role> {
return Db.collections.Role.findOneOrFail({
where: {
name,
scope,
},
});
}
/**
* Return the n8n instance base URL without trailing slash.
*/