mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-15 05:11:42 +08:00
user groups commands
This commit is contained in:
@@ -37,13 +37,6 @@ func ListUsers() *[]models.ReturnUser {
|
||||
return request[[]models.ReturnUser](http.MethodGet, "/api/users", nil)
|
||||
}
|
||||
|
||||
func CreateUserRole(role models.UserRolePermissionTemplate) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodPost, "/api/v1/users/role", role)
|
||||
}
|
||||
func UpdateUserRole(role models.UserRolePermissionTemplate) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodPut, "/api/v1/users/role", role)
|
||||
}
|
||||
|
||||
func ListUserRoles() *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodGet, "/api/v1/users/roles", nil)
|
||||
}
|
||||
@@ -55,11 +48,13 @@ func GetUserRole(roleID string) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodGet, fmt.Sprintf("/api/v1/users/role?role_id=%s", roleID), nil)
|
||||
}
|
||||
|
||||
/*
|
||||
func ListUserGrps() *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodGet, "/api/v1/users/groups", nil)
|
||||
}
|
||||
|
||||
r.HandleFunc("/api/v1/users/roles", logic.SecurityCheck(true, http.HandlerFunc(listRoles))).Methods(http.MethodGet)
|
||||
r.HandleFunc("/api/v1/users/role", logic.SecurityCheck(true, http.HandlerFunc(getRole))).Methods(http.MethodGet)
|
||||
r.HandleFunc("/api/v1/users/role", logic.SecurityCheck(true, http.HandlerFunc(createRole))).Methods(http.MethodPost)
|
||||
r.HandleFunc("/api/v1/users/role", logic.SecurityCheck(true, http.HandlerFunc(updateRole))).Methods(http.MethodPut)
|
||||
r.HandleFunc("/api/v1/users/role", logic.SecurityCheck(true, http.HandlerFunc(deleteRole))).Methods(http.MethodDelete)
|
||||
*/
|
||||
func DeleteUserGrp(grpID string) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodDelete, fmt.Sprintf("/api/v1/users/group?group_id=%s", grpID), nil)
|
||||
}
|
||||
func GetUserGrp(grpID string) *models.SuccessResponse {
|
||||
return request[models.SuccessResponse](http.MethodGet, fmt.Sprintf("/api/v1/users/group?group_id=%s", grpID), nil)
|
||||
}
|
||||
|
Reference in New Issue
Block a user