Skip to content
Snippets Groups Projects
Commit bf848168 authored by Florent Gluck's avatar Florent Gluck
Browse files

Backend: finished handling the new EXAM_ATTACH capability.

Bumped server version to 1.11.3
parent 2ea9aacc
No related branches found
No related tags found
No related merge requests found
......@@ -204,7 +204,7 @@ func (r *RouterVMs)VMSpiceCreds(c echo.Context) error {
// Returns the Spice credentials for the VM matching the specific VM attach password.
// Output: nexus-common/vm.VMSpiceCredentialsSerialized
// Requires the CAP_VM_ATTACH_ANY user capability:
// Requires either CAP_EXAM_ATTACH or CAP_VM_ATTACH_ANY user capability:
// curl --cacert ca.pem -X POST https://localhost:1077/vms/spicecreds -H 'Content-Type: application/json' -d '{"pwd":"46L8drgZ5Dx"}' -H "Authorization: Bearer <AccessToken>"
func (r *RouterVMs)VMSpiceCredsAny(c echo.Context) error {
// Retrieves logged user from context.
......@@ -213,7 +213,7 @@ func (r *RouterVMs)VMSpiceCredsAny(c echo.Context) error {
return echo.NewHTTPError(http.StatusUnauthorized, err.Error())
}
if !user.HasCapability(caps.CAP_VM_ATTACH_ANY) {
if !(user.HasCapability(caps.CAP_VM_ATTACH_ANY) || user.HasCapability(caps.CAP_EXAM_ATTACH)) {
return echo.NewHTTPError(http.StatusUnauthorized, errors.New("Access denied"))
}
......
......@@ -7,7 +7,7 @@ import (
const (
major = 1
minor = 11
bugfix = 2
bugfix = 3
)
var version params.Version = params.NewVersion(major, minor, bugfix)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment