forked from baron/baron-sso
Merge pull request 'feature/1183-signup-personal-default' (#1187) from feature/1183-signup-personal-default into dev
Reviewed-on: baron/baron-sso#1187
This commit is contained in:
@@ -97,6 +97,8 @@ type tenantPermissions struct {
|
||||
ManageOrganization bool `json:"manage_organization"`
|
||||
ViewSchema bool `json:"view_schema"`
|
||||
ManageSchema bool `json:"manage_schema"`
|
||||
ViewWorksmobile bool `json:"view_worksmobile"`
|
||||
ManageWorksmobile bool `json:"manage_worksmobile"`
|
||||
}
|
||||
|
||||
type tenantSummary struct {
|
||||
@@ -1742,6 +1744,8 @@ func (h *TenantHandler) GetTenant(c *fiber.Ctx) error {
|
||||
ManageOrganization: true,
|
||||
ViewSchema: true,
|
||||
ManageSchema: true,
|
||||
ViewWorksmobile: true,
|
||||
ManageWorksmobile: true,
|
||||
}
|
||||
} else {
|
||||
// Query Keto in parallel for maximum performance
|
||||
@@ -1751,13 +1755,14 @@ func (h *TenantHandler) GetTenant(c *fiber.Ctx) error {
|
||||
allowed bool
|
||||
err error
|
||||
}
|
||||
ch := make(chan checkResult, 11)
|
||||
ch := make(chan checkResult, 13)
|
||||
relations := []string{
|
||||
"view", "manage", "manage_admins",
|
||||
"view_profile", "manage_profile",
|
||||
"view_permissions", "manage_permissions",
|
||||
"view_organization", "manage_organization",
|
||||
"view_schema", "manage_schema",
|
||||
"view_worksmobile", "manage_worksmobile",
|
||||
}
|
||||
for _, rel := range relations {
|
||||
go func(r string) {
|
||||
@@ -1796,6 +1801,10 @@ func (h *TenantHandler) GetTenant(c *fiber.Ctx) error {
|
||||
perms.ViewSchema = res.allowed
|
||||
case "manage_schema":
|
||||
perms.ManageSchema = res.allowed
|
||||
case "view_worksmobile":
|
||||
perms.ViewWorksmobile = res.allowed
|
||||
case "manage_worksmobile":
|
||||
perms.ManageWorksmobile = res.allowed
|
||||
}
|
||||
}
|
||||
summary.UserPermissions = perms
|
||||
|
||||
Reference in New Issue
Block a user