Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
permissions.h File Reference

Cross-platform permission status and request interface. More...

#include <filesystem>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for permissions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  platf::permission_status_t
 Access needed by the current Sunshine configuration. More...

Functions

bool platf::can_access_directory (const std::filesystem::path &path)
 Check whether this process can list and create files in a directory.
std::vector< permission_status_t > platf::get_permission_statuses ()
 Query access needed by Sunshine on the current platform.
bool platf::request_permission (std::string_view id)
 Initiate a native request or settings action for an access item.
bool platf::required_permissions_granted (const std::vector< permission_status_t > &permissions)
 Determine whether all verifiable required permissions are granted.

Detailed Description

Cross-platform permission status and request interface.

Function Documentation

◆ can_access_directory()

bool platf::can_access_directory ( const std::filesystem::path & path)

Check whether this process can list and create files in a directory.

Parameters
pathDirectory to check without modifying its contents.
Returns
True when the directory is present and accessible.

◆ get_permission_statuses()

std::vector< permission_status_t > platf::get_permission_statuses ( )

Query access needed by Sunshine on the current platform.

Returns
Permission status records for the Web UI.

◆ request_permission()

bool platf::request_permission ( std::string_view id)

Initiate a native request or settings action for an access item.

On macOS, Local Network opens Privacy & Security, where the user selects Local Network.

Parameters
idStable identifier of the access item.
Returns
True when the action was recognized and initiated.

◆ required_permissions_granted()

bool platf::required_permissions_granted ( const std::vector< permission_status_t > & permissions)

Determine whether all verifiable required permissions are granted.

Parameters
permissionsCurrent permission status records.
Returns
True when no verifiable required permission is missing.