mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-13 12:34:30 +08:00
convert network roles to groups, deprecate RAG roles
This commit is contained in:
@@ -253,19 +253,6 @@ func updateHost(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
newHost := newHostData.ConvertAPIHostToNMHost(currHost)
|
newHost := newHostData.ConvertAPIHostToNMHost(currHost)
|
||||||
|
|
||||||
if newHost.Name != currHost.Name {
|
|
||||||
// update any rag role ids
|
|
||||||
for _, nodeID := range newHost.Nodes {
|
|
||||||
node, err := logic.GetNodeByID(nodeID)
|
|
||||||
if err == nil && node.IsIngressGateway {
|
|
||||||
role, err := logic.GetRole(models.GetRAGRoleID(node.Network, currHost.ID.String()))
|
|
||||||
if err == nil {
|
|
||||||
role.UiName = models.GetRAGRoleName(node.Network, newHost.Name)
|
|
||||||
logic.UpdateRole(role)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logic.UpdateHost(newHost, currHost) // update the in memory struct values
|
logic.UpdateHost(newHost, currHost) // update the in memory struct values
|
||||||
if err = logic.UpsertHost(newHost); err != nil {
|
if err = logic.UpsertHost(newHost); err != nil {
|
||||||
logger.Log(0, r.Header.Get("user"), "failed to update a host:", err.Error())
|
logger.Log(0, r.Header.Get("user"), "failed to update a host:", err.Error())
|
||||||
|
@@ -188,30 +188,6 @@ func CreateIngressGateway(netid string, nodeid string, ingress models.IngressReq
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return models.Node{}, err
|
return models.Node{}, err
|
||||||
}
|
}
|
||||||
// create network role for this gateway
|
|
||||||
CreateRole(models.UserRolePermissionTemplate{
|
|
||||||
ID: models.GetRAGRoleID(node.Network, host.ID.String()),
|
|
||||||
UiName: models.GetRAGRoleName(node.Network, host.Name),
|
|
||||||
NetworkID: models.NetworkID(node.Network),
|
|
||||||
Default: true,
|
|
||||||
NetworkLevelAccess: map[models.RsrcType]map[models.RsrcID]models.RsrcPermissionScope{
|
|
||||||
models.RemoteAccessGwRsrc: {
|
|
||||||
models.RsrcID(node.ID.String()): models.RsrcPermissionScope{
|
|
||||||
Read: true,
|
|
||||||
VPNaccess: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
models.ExtClientsRsrc: {
|
|
||||||
models.AllExtClientsRsrcID: models.RsrcPermissionScope{
|
|
||||||
Read: true,
|
|
||||||
Create: true,
|
|
||||||
Update: true,
|
|
||||||
Delete: true,
|
|
||||||
SelfOnly: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
err = SetNetworkNodesLastModified(netid)
|
err = SetNetworkNodesLastModified(netid)
|
||||||
return node, err
|
return node, err
|
||||||
}
|
}
|
||||||
|
@@ -294,7 +294,7 @@ func UpdateHostFromClient(newHost, currHost *models.Host) (sendPeerUpdate bool)
|
|||||||
if err == nil && node.IsIngressGateway {
|
if err == nil && node.IsIngressGateway {
|
||||||
role, err := GetRole(models.GetRAGRoleID(node.Network, currHost.ID.String()))
|
role, err := GetRole(models.GetRAGRoleID(node.Network, currHost.ID.String()))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
role.UiName = models.GetRAGRoleName(node.Network, newHost.Name)
|
role.Name = models.GetRAGRoleName(node.Network, newHost.Name)
|
||||||
UpdateRole(role)
|
UpdateRole(role)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,11 +46,16 @@ var IsNetworkRolesValid = func(networkRoles map[models.NetworkID]map[models.User
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var MigrateUserRoleAndGroups = func(u models.User) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var UpdateUserGwAccess = func(currentUser, changeUser models.User) {}
|
var UpdateUserGwAccess = func(currentUser, changeUser models.User) {}
|
||||||
|
|
||||||
var UpdateRole = func(r models.UserRolePermissionTemplate) error { return nil }
|
var UpdateRole = func(r models.UserRolePermissionTemplate) error { return nil }
|
||||||
|
|
||||||
var InitialiseRoles = userRolesInit
|
var InitialiseRoles = userRolesInit
|
||||||
|
var IntialiseGroups = func() {}
|
||||||
var DeleteNetworkRoles = func(netID string) {}
|
var DeleteNetworkRoles = func(netID string) {}
|
||||||
var CreateDefaultNetworkRolesAndGroups = func(netID models.NetworkID) {}
|
var CreateDefaultNetworkRolesAndGroups = func(netID models.NetworkID) {}
|
||||||
var CreateDefaultUserPolicies = func(netID models.NetworkID) {}
|
var CreateDefaultUserPolicies = func(netID models.NetworkID) {}
|
||||||
|
1
main.go
1
main.go
@@ -103,6 +103,7 @@ func initialize() { // Client Mode Prereq Check
|
|||||||
|
|
||||||
logic.SetJWTSecret()
|
logic.SetJWTSecret()
|
||||||
logic.InitialiseRoles()
|
logic.InitialiseRoles()
|
||||||
|
logic.IntialiseGroups()
|
||||||
err = serverctl.SetDefaults()
|
err = serverctl.SetDefaults()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.FatalLog("error setting defaults: ", err.Error())
|
logger.FatalLog("error setting defaults: ", err.Error())
|
||||||
|
@@ -178,7 +178,10 @@ func updateNodes() {
|
|||||||
node.Tags[tagID] = struct{}{}
|
node.Tags[tagID] = struct{}{}
|
||||||
logic.UpsertNode(&node)
|
logic.UpsertNode(&node)
|
||||||
}
|
}
|
||||||
|
host, err := logic.GetHost(node.HostID.String())
|
||||||
|
if err == nil {
|
||||||
|
go logic.DeleteRole(models.GetRAGRoleID(node.Network, host.ID.String()), true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if node.IsEgressGateway {
|
if node.IsEgressGateway {
|
||||||
egressRanges, update := removeInterGw(node.EgressGatewayRanges)
|
egressRanges, update := removeInterGw(node.EgressGatewayRanges)
|
||||||
@@ -356,42 +359,8 @@ func syncUsers() {
|
|||||||
// create default network user roles for existing networks
|
// create default network user roles for existing networks
|
||||||
if servercfg.IsPro {
|
if servercfg.IsPro {
|
||||||
networks, _ := logic.GetNetworks()
|
networks, _ := logic.GetNetworks()
|
||||||
nodes, err := logic.GetAllNodes()
|
for _, netI := range networks {
|
||||||
if err == nil {
|
logic.CreateDefaultNetworkRolesAndGroups(models.NetworkID(netI.NetID))
|
||||||
for _, netI := range networks {
|
|
||||||
logic.CreateDefaultNetworkRolesAndGroups(models.NetworkID(netI.NetID))
|
|
||||||
networkNodes := logic.GetNetworkNodesMemory(nodes, netI.NetID)
|
|
||||||
for _, networkNodeI := range networkNodes {
|
|
||||||
if networkNodeI.IsIngressGateway {
|
|
||||||
h, err := logic.GetHost(networkNodeI.HostID.String())
|
|
||||||
if err == nil {
|
|
||||||
logic.CreateRole(models.UserRolePermissionTemplate{
|
|
||||||
ID: models.GetRAGRoleID(networkNodeI.Network, h.ID.String()),
|
|
||||||
UiName: models.GetRAGRoleName(networkNodeI.Network, h.Name),
|
|
||||||
NetworkID: models.NetworkID(netI.NetID),
|
|
||||||
NetworkLevelAccess: map[models.RsrcType]map[models.RsrcID]models.RsrcPermissionScope{
|
|
||||||
models.RemoteAccessGwRsrc: {
|
|
||||||
models.RsrcID(networkNodeI.ID.String()): models.RsrcPermissionScope{
|
|
||||||
Read: true,
|
|
||||||
VPNaccess: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
models.ExtClientsRsrc: {
|
|
||||||
models.AllExtClientsRsrcID: models.RsrcPermissionScope{
|
|
||||||
Read: true,
|
|
||||||
Create: true,
|
|
||||||
Update: true,
|
|
||||||
Delete: true,
|
|
||||||
SelfOnly: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,34 +398,11 @@ func syncUsers() {
|
|||||||
user.PlatformRoleID = models.ServiceUser
|
user.PlatformRoleID = models.ServiceUser
|
||||||
}
|
}
|
||||||
logic.UpsertUser(user)
|
logic.UpsertUser(user)
|
||||||
if len(user.RemoteGwIDs) > 0 {
|
logic.MigrateUserRoleAndGroups(user)
|
||||||
// define user roles for network
|
|
||||||
// assign relevant network role to user
|
|
||||||
for remoteGwID := range user.RemoteGwIDs {
|
|
||||||
gwNode, err := logic.GetNodeByID(remoteGwID)
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
h, err := logic.GetHost(gwNode.HostID.String())
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
r, err := logic.GetRole(models.GetRAGRoleID(gwNode.Network, h.ID.String()))
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if netRoles, ok := user.NetworkRoles[models.NetworkID(gwNode.Network)]; ok {
|
|
||||||
netRoles[r.ID] = struct{}{}
|
|
||||||
} else {
|
|
||||||
user.NetworkRoles[models.NetworkID(gwNode.Network)] = map[models.UserRoleID]struct{}{
|
|
||||||
r.ID: {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logic.UpsertUser(user)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func createDefaultTagsAndPolicies() {
|
func createDefaultTagsAndPolicies() {
|
||||||
|
@@ -116,8 +116,9 @@ type RsrcPermissionScope struct {
|
|||||||
|
|
||||||
type UserRolePermissionTemplate struct {
|
type UserRolePermissionTemplate struct {
|
||||||
ID UserRoleID `json:"id"`
|
ID UserRoleID `json:"id"`
|
||||||
UiName string `json:"ui_name"`
|
Name string `json:"name"`
|
||||||
Default bool `json:"default"`
|
Default bool `json:"default"`
|
||||||
|
MetaData string `json:"meta_data"`
|
||||||
DenyDashboardAccess bool `json:"deny_dashboard_access"`
|
DenyDashboardAccess bool `json:"deny_dashboard_access"`
|
||||||
FullAccess bool `json:"full_access"`
|
FullAccess bool `json:"full_access"`
|
||||||
NetworkID NetworkID `json:"network_id"`
|
NetworkID NetworkID `json:"network_id"`
|
||||||
@@ -132,6 +133,8 @@ type CreateGroupReq struct {
|
|||||||
|
|
||||||
type UserGroup struct {
|
type UserGroup struct {
|
||||||
ID UserGroupID `json:"id"`
|
ID UserGroupID `json:"id"`
|
||||||
|
Default bool `json:"default"`
|
||||||
|
Name string `json:"name"`
|
||||||
NetworkRoles map[NetworkID]map[UserRoleID]struct{} `json:"network_roles"`
|
NetworkRoles map[NetworkID]map[UserRoleID]struct{} `json:"network_roles"`
|
||||||
MetaData string `json:"meta_data"`
|
MetaData string `json:"meta_data"`
|
||||||
}
|
}
|
||||||
|
@@ -136,6 +136,8 @@ func InitPro() {
|
|||||||
logic.InitialiseRoles = proLogic.UserRolesInit
|
logic.InitialiseRoles = proLogic.UserRolesInit
|
||||||
logic.UpdateUserGwAccess = proLogic.UpdateUserGwAccess
|
logic.UpdateUserGwAccess = proLogic.UpdateUserGwAccess
|
||||||
logic.CreateDefaultUserPolicies = proLogic.CreateDefaultUserPolicies
|
logic.CreateDefaultUserPolicies = proLogic.CreateDefaultUserPolicies
|
||||||
|
logic.MigrateUserRoleAndGroups = proLogic.MigrateUserRoleAndGroups
|
||||||
|
logic.IntialiseGroups = proLogic.UserGroupsInit
|
||||||
}
|
}
|
||||||
|
|
||||||
func retrieveProLogo() string {
|
func retrieveProLogo() string {
|
||||||
|
54
pro/logic/migrate.go
Normal file
54
pro/logic/migrate.go
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/gravitl/netmaker/logic"
|
||||||
|
"github.com/gravitl/netmaker/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
func MigrateUserRoleAndGroups(user models.User) {
|
||||||
|
var err error
|
||||||
|
if len(user.RemoteGwIDs) > 0 {
|
||||||
|
// define user roles for network
|
||||||
|
// assign relevant network role to user
|
||||||
|
for remoteGwID := range user.RemoteGwIDs {
|
||||||
|
gwNode, err := logic.GetNodeByID(remoteGwID)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var g models.UserGroup
|
||||||
|
if user.PlatformRoleID == models.ServiceUser {
|
||||||
|
g, err = GetUserGroup(models.UserGroupID(fmt.Sprintf("%s-%s-grp", gwNode.Network, models.NetworkUser)))
|
||||||
|
} else {
|
||||||
|
g, err = GetUserGroup(models.UserGroupID(fmt.Sprintf("%s-%s-grp",
|
||||||
|
gwNode.Network, models.NetworkAdmin)))
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
user.UserGroups[g.ID] = struct{}{}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(user.NetworkRoles) > 0 {
|
||||||
|
for netID := range user.NetworkRoles {
|
||||||
|
var g models.UserGroup
|
||||||
|
if user.PlatformRoleID == models.ServiceUser {
|
||||||
|
g, err = GetUserGroup(models.UserGroupID(fmt.Sprintf("%s-%s-grp", netID, models.NetworkUser)))
|
||||||
|
} else {
|
||||||
|
g, err = GetUserGroup(models.UserGroupID(fmt.Sprintf("%s-%s-grp",
|
||||||
|
netID, models.NetworkAdmin)))
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
user.UserGroups[g.ID] = struct{}{}
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
logic.UpsertUser(user)
|
||||||
|
}
|
@@ -30,6 +30,8 @@ var PlatformUserUserPermissionTemplate = models.UserRolePermissionTemplate{
|
|||||||
|
|
||||||
var NetworkAdminAllPermissionTemplate = models.UserRolePermissionTemplate{
|
var NetworkAdminAllPermissionTemplate = models.UserRolePermissionTemplate{
|
||||||
ID: models.UserRoleID(fmt.Sprintf("global-%s", models.NetworkAdmin)),
|
ID: models.UserRoleID(fmt.Sprintf("global-%s", models.NetworkAdmin)),
|
||||||
|
Name: "Network Admins",
|
||||||
|
MetaData: "Users with this role can manage all your networks configuration including adding and removing devices.",
|
||||||
Default: true,
|
Default: true,
|
||||||
FullAccess: true,
|
FullAccess: true,
|
||||||
NetworkID: models.AllNetworks,
|
NetworkID: models.AllNetworks,
|
||||||
@@ -37,6 +39,8 @@ var NetworkAdminAllPermissionTemplate = models.UserRolePermissionTemplate{
|
|||||||
|
|
||||||
var NetworkUserAllPermissionTemplate = models.UserRolePermissionTemplate{
|
var NetworkUserAllPermissionTemplate = models.UserRolePermissionTemplate{
|
||||||
ID: models.UserRoleID(fmt.Sprintf("global-%s", models.NetworkUser)),
|
ID: models.UserRoleID(fmt.Sprintf("global-%s", models.NetworkUser)),
|
||||||
|
Name: "Network Users",
|
||||||
|
MetaData: "Users with this role Cannot access the admin console, but can connect to nodes in your networks via RAC.",
|
||||||
Default: true,
|
Default: true,
|
||||||
FullAccess: false,
|
FullAccess: false,
|
||||||
NetworkID: models.AllNetworks,
|
NetworkID: models.AllNetworks,
|
||||||
@@ -75,12 +79,44 @@ func UserRolesInit() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UserGroupsInit() {
|
||||||
|
// create default network groups
|
||||||
|
var NetworkGlobalAdminGroup = models.UserGroup{
|
||||||
|
ID: models.UserGroupID(fmt.Sprintf("global-%s-grp", models.NetworkAdmin)),
|
||||||
|
Default: true,
|
||||||
|
Name: "Network Admin Group",
|
||||||
|
MetaData: "Users in this group can manage all your networks configuration including adding and removing devices.",
|
||||||
|
NetworkRoles: map[models.NetworkID]map[models.UserRoleID]struct{}{
|
||||||
|
models.NetworkID("*"): {
|
||||||
|
models.UserRoleID(fmt.Sprintf("global-%s", models.NetworkAdmin)): {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
var NetworkGlobalUserGroup = models.UserGroup{
|
||||||
|
ID: models.UserGroupID(fmt.Sprintf("global-%s-grp", models.NetworkUser)),
|
||||||
|
Name: "Network User Group",
|
||||||
|
Default: true,
|
||||||
|
NetworkRoles: map[models.NetworkID]map[models.UserRoleID]struct{}{
|
||||||
|
models.NetworkID("*"): {
|
||||||
|
models.UserRoleID(fmt.Sprintf("global-%s", models.NetworkUser)): {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MetaData: "Users in this group cannot access the admin console, but can connect to nodes in your networks via RAC.",
|
||||||
|
}
|
||||||
|
d, _ := json.Marshal(NetworkGlobalAdminGroup)
|
||||||
|
database.Insert(NetworkGlobalAdminGroup.ID.String(), string(d), database.USER_GROUPS_TABLE_NAME)
|
||||||
|
d, _ = json.Marshal(NetworkGlobalUserGroup)
|
||||||
|
database.Insert(NetworkGlobalUserGroup.ID.String(), string(d), database.USER_GROUPS_TABLE_NAME)
|
||||||
|
}
|
||||||
|
|
||||||
func CreateDefaultNetworkRolesAndGroups(netID models.NetworkID) {
|
func CreateDefaultNetworkRolesAndGroups(netID models.NetworkID) {
|
||||||
if netID.String() == "" {
|
if netID.String() == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var NetworkAdminPermissionTemplate = models.UserRolePermissionTemplate{
|
var NetworkAdminPermissionTemplate = models.UserRolePermissionTemplate{
|
||||||
ID: models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkAdmin)),
|
ID: models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkAdmin)),
|
||||||
|
Name: fmt.Sprintf("%s Admin", netID),
|
||||||
|
MetaData: fmt.Sprintf("Users with this role can manage your network `%s` configuration including adding and removing devices.", netID),
|
||||||
Default: true,
|
Default: true,
|
||||||
NetworkID: netID,
|
NetworkID: netID,
|
||||||
FullAccess: true,
|
FullAccess: true,
|
||||||
@@ -89,6 +125,8 @@ func CreateDefaultNetworkRolesAndGroups(netID models.NetworkID) {
|
|||||||
|
|
||||||
var NetworkUserPermissionTemplate = models.UserRolePermissionTemplate{
|
var NetworkUserPermissionTemplate = models.UserRolePermissionTemplate{
|
||||||
ID: models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkUser)),
|
ID: models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkUser)),
|
||||||
|
Name: fmt.Sprintf("%s User", netID),
|
||||||
|
MetaData: fmt.Sprintf("Users Cannot access the admin console, but can connect to nodes in your network `%s` via RAC.", netID),
|
||||||
Default: true,
|
Default: true,
|
||||||
FullAccess: false,
|
FullAccess: false,
|
||||||
NetworkID: netID,
|
NetworkID: netID,
|
||||||
@@ -118,22 +156,24 @@ func CreateDefaultNetworkRolesAndGroups(netID models.NetworkID) {
|
|||||||
|
|
||||||
// create default network groups
|
// create default network groups
|
||||||
var NetworkAdminGroup = models.UserGroup{
|
var NetworkAdminGroup = models.UserGroup{
|
||||||
ID: models.UserGroupID(fmt.Sprintf("%s-%s-grp", netID, models.NetworkAdmin)),
|
ID: models.UserGroupID(fmt.Sprintf("%s-%s-grp", netID, models.NetworkAdmin)),
|
||||||
|
Name: fmt.Sprintf("%s Admin Group", netID),
|
||||||
NetworkRoles: map[models.NetworkID]map[models.UserRoleID]struct{}{
|
NetworkRoles: map[models.NetworkID]map[models.UserRoleID]struct{}{
|
||||||
netID: {
|
netID: {
|
||||||
models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkAdmin)): {},
|
models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkAdmin)): {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
MetaData: "The network group was automatically created by Netmaker.",
|
MetaData: fmt.Sprintf("User in this group can manage your network `%s` configuration including adding and removing devices.", netID),
|
||||||
}
|
}
|
||||||
var NetworkUserGroup = models.UserGroup{
|
var NetworkUserGroup = models.UserGroup{
|
||||||
ID: models.UserGroupID(fmt.Sprintf("%s-%s-grp", netID, models.NetworkUser)),
|
ID: models.UserGroupID(fmt.Sprintf("%s-%s-grp", netID, models.NetworkUser)),
|
||||||
|
Name: fmt.Sprintf("%s User Group", netID),
|
||||||
NetworkRoles: map[models.NetworkID]map[models.UserRoleID]struct{}{
|
NetworkRoles: map[models.NetworkID]map[models.UserRoleID]struct{}{
|
||||||
netID: {
|
netID: {
|
||||||
models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkUser)): {},
|
models.UserRoleID(fmt.Sprintf("%s-%s", netID, models.NetworkUser)): {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
MetaData: "The network group was automatically created by Netmaker.",
|
MetaData: fmt.Sprintf("Users in this group cannot access the admin console, but can connect to nodes in your network `%s` via RAC.", netID),
|
||||||
}
|
}
|
||||||
d, _ = json.Marshal(NetworkAdminGroup)
|
d, _ = json.Marshal(NetworkAdminGroup)
|
||||||
database.Insert(NetworkAdminGroup.ID.String(), string(d), database.USER_GROUPS_TABLE_NAME)
|
database.Insert(NetworkAdminGroup.ID.String(), string(d), database.USER_GROUPS_TABLE_NAME)
|
||||||
|
Reference in New Issue
Block a user