ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
list_roles_response Struct Referencefinal

Response containing all roles. More...

#include <authorization_protocol.hpp>

Collaboration diagram for list_roles_response:
Collaboration graph

Public Member Functions

std::vector< std::byte > serialize () const
 Serialize response to bytes.
 

Static Public Member Functions

static std::expected< list_roles_response, comms::messaging::error_code > deserialize (std::span< const std::byte > data)
 Deserialize response from bytes.
 

Public Attributes

std::vector< domain::roleroles
 

Detailed Description

Response containing all roles.

Member Function Documentation

◆ serialize()

std::vector< std::byte > serialize ( ) const

Serialize response to bytes.

Format:

  • 4 bytes: count (number of roles)
  • For each role:
    • 4 bytes: version
    • 16 bytes: id (UUID)
    • 2 bytes: name length
    • N bytes: name (UTF-8)
    • 2 bytes: description length
    • N bytes: description (UTF-8)
    • 2 bytes: recorded_by length
    • N bytes: recorded_by (UTF-8)
    • 2 bytes: recorded_at length
    • N bytes: recorded_at (UTF-8)
    • 4 bytes: permission_codes count
    • For each permission code:
      • 2 bytes: code length
      • N bytes: code (UTF-8)