void dvr_autorec_update(void);
-static inline int dvr_autorec_entry_verify(dvr_autorec_entry_t *dae, access_t *a)
+static inline int
+ dvr_autorec_entry_verify(dvr_autorec_entry_t *dae, access_t *a, int readonly)
{
+ if (readonly && !access_verify2(a, ACCESS_ALL_RECORDER))
+ return 0;
if (!access_verify2(a, ACCESS_ALL_RW_RECORDER))
return 0;
if (strcmp(dae->dae_owner ?: "", a->aa_username ?: ""))
void dvr_timerec_update(void);
-static inline int dvr_timerec_entry_verify(dvr_timerec_entry_t *dte, access_t *a)
+static inline int dvr_timerec_entry_verify
+ (dvr_timerec_entry_t *dte, access_t *a, int readonly)
{
+ if (readonly && !access_verify2(a, ACCESS_ALL_RECORDER))
+ return 0;
if (!access_verify2(a, ACCESS_ALL_RW_RECORDER))
return 0;
if (strcmp(dte->dte_owner ?: "", a->aa_username ?: ""))
/* Send all autorecs */
TAILQ_FOREACH(dae, &autorec_entries, dae_link)
- if (!dvr_autorec_entry_verify(dae, htsp->htsp_granted_access))
+ if (!dvr_autorec_entry_verify(dae, htsp->htsp_granted_access, 1))
htsp_send_message(htsp, htsp_build_autorecentry(dae, "autorecEntryAdd"), NULL);
/* Send all timerecs */
TAILQ_FOREACH(dte, &timerec_entries, dte_link)
- if (!dvr_timerec_entry_verify(dte, htsp->htsp_granted_access))
+ if (!dvr_timerec_entry_verify(dte, htsp->htsp_granted_access, 1))
htsp_send_message(htsp, htsp_build_timerecentry(dte, "timerecEntryAdd"), NULL);
/* Send all DVR entries */
if((dae = dvr_autorec_find_by_uuid(daeId)) == NULL)
return htsp_error("id not found");
- if(dvr_autorec_entry_verify(dae, htsp->htsp_granted_access))
+ if(dvr_autorec_entry_verify(dae, htsp->htsp_granted_access, 0))
return htsp_error("User does not have access");
/* Check access */
if((dte = dvr_timerec_find_by_uuid(dteId)) == NULL)
return htsp_error("id not found");
- if(dvr_timerec_entry_verify(dte, htsp->htsp_granted_access))
+ if(dvr_timerec_entry_verify(dte, htsp->htsp_granted_access, 0))
return htsp_error("User does not have access");
/* Check access */
LIST_FOREACH(htsp, &htsp_async_connections, htsp_async_link) {
if (htsp->htsp_async_mode & HTSP_ASYNC_ON) {
if ((dae->dae_channel == NULL || htsp_user_access_channel(htsp, dae->dae_channel)) &&
- !dvr_autorec_entry_verify(dae, htsp->htsp_granted_access)) {
+ !dvr_autorec_entry_verify(dae, htsp->htsp_granted_access, 1)) {
htsmsg_t *m = msg ? htsmsg_copy(msg)
: htsp_build_autorecentry(dae, method);
htsp_send_message(htsp, m, NULL);
LIST_FOREACH(htsp, &htsp_async_connections, htsp_async_link) {
if (htsp->htsp_async_mode & HTSP_ASYNC_ON) {
if ((dte->dte_channel == NULL || htsp_user_access_channel(htsp, dte->dte_channel)) &&
- !dvr_timerec_entry_verify(dte, htsp->htsp_granted_access)) {
+ !dvr_timerec_entry_verify(dte, htsp->htsp_granted_access, 1)) {
htsmsg_t *m = msg ? htsmsg_copy(msg)
: htsp_build_timerecentry(dte, method);
htsp_send_message(htsp, m, NULL);