Enable to access to DVR entries created by other users with the ability to
remove the DVR entries.
+ <dt><b>Failed DVR</b>
+ <dd>
+ Enable to access to DVR entries which were not succesfuly recorded.
+
<dt><b>DVR Config Profile</b>
<dd>
If set, the user will only be able to use the DVR config profile
r |= ACCESS_ADVANCED_STREAMING;
if (ae->ae_htsp_streaming)
r |= ACCESS_HTSP_STREAMING;
+ if (ae->ae_webui)
+ r |= ACCESS_WEB_INTERFACE;
if (ae->ae_dvr)
r |= ACCESS_RECORDER;
if (ae->ae_htsp_dvr)
r |= ACCESS_HTSP_RECORDER;
if (ae->ae_all_dvr)
r |= ACCESS_ALL_RECORDER;
- if (ae->ae_webui)
- r |= ACCESS_WEB_INTERFACE;
- if (ae->ae_admin)
- r |= ACCESS_ADMIN;
if (ae->ae_all_rw_dvr)
r |= ACCESS_ALL_RW_RECORDER;
+ if (ae->ae_failed_dvr)
+ r |= ACCESS_FAILED_RECORDER;
+ if (ae->ae_admin)
+ r |= ACCESS_ADMIN;
ae->ae_rights = r;
}
ae->ae_htsp_streaming = 1;
ae->ae_htsp_dvr = 1;
ae->ae_all_dvr = 1;
+ ae->ae_failed_dvr = 1;
idnode_load(&ae->ae_id, conf);
/* note password has PO_NOSAVE, thus it must be set manually */
if ((s = htsmsg_get_str(conf, "password")) != NULL)
.name = "All DVR (rw)",
.off = offsetof(access_entry_t, ae_all_rw_dvr),
},
+ {
+ .type = PT_BOOL,
+ .id = "failed_dvr",
+ .name = "Failed DVR",
+ .off = offsetof(access_entry_t, ae_failed_dvr),
+ .opts = PO_ADVANCED | PO_HIDDEN,
+ },
{
.type = PT_STR,
.id = "dvr_config",
ae->ae_streaming = 1;
ae->ae_adv_streaming = 1;
ae->ae_htsp_streaming = 1;
+ ae->ae_webui = 1;
ae->ae_dvr = 1;
ae->ae_htsp_dvr = 1;
ae->ae_all_dvr = 1;
ae->ae_all_rw_dvr = 1;
- ae->ae_webui = 1;
+ ae->ae_failed_dvr = 1;
ae->ae_admin = 1;
access_entry_update_rights(ae);
int ae_htsp_dvr;
int ae_all_dvr;
int ae_all_rw_dvr;
+ int ae_failed_dvr;
struct dvr_config *ae_dvr_config;
LIST_ENTRY(access_entry) ae_dvr_config_link;
#define ACCESS_RECORDER (1<<4)
#define ACCESS_HTSP_RECORDER (1<<5)
#define ACCESS_ALL_RECORDER (1<<6)
-#define ACCESS_ADMIN (1<<7)
-#define ACCESS_ALL_RW_RECORDER (1<<8)
+#define ACCESS_ALL_RW_RECORDER (1<<7)
+#define ACCESS_FAILED_RECORDER (1<<8)
+#define ACCESS_ADMIN (1<<9)
#define ACCESS_OR (1<<30)
#define ACCESS_FULL \
(ACCESS_STREAMING | ACCESS_ADVANCED_STREAMING | \
ACCESS_HTSP_STREAMING | ACCESS_WEB_INTERFACE | \
ACCESS_RECORDER | ACCESS_HTSP_RECORDER | \
- ACCESS_ALL_RECORDER | ACCESS_ADMIN | ACCESS_ALL_RW_RECORDER)
+ ACCESS_ALL_RECORDER | ACCESS_ALL_RW_RECORDER | \
+ ACCESS_FAILED_RECORDER | ACCESS_ADMIN)
/**
* Create a new ticket for the requested resource and generate a id for it
htsmsg_t *dvr_entry_class_config_name_list(void *o);
htsmsg_t *dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step);
-static inline int dvr_entry_verify(dvr_entry_t *de, 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(de->de_owner ?: "", a->aa_username ?: ""))
- return -1;
- return 0;
-}
+int dvr_entry_verify(dvr_entry_t *de, access_t *a, int readonly);
/**
*
static int dvr_entry_class_disp_title_set(void *o, const void *v);
static int dvr_entry_class_disp_subtitle_set(void *o, const void *v);
+/*
+ *
+ */
+int
+dvr_entry_verify(dvr_entry_t *de, access_t *a, int readonly)
+{
+ if (access_verify2(a, ACCESS_FAILED_RECORDER) &&
+ (de->de_sched_state == DVR_COMPLETED &&
+ de->de_last_error != SM_CODE_OK))
+ return -1;
+
+ if (readonly && !access_verify2(a, ACCESS_ALL_RECORDER))
+ return 0;
+
+ if (!access_verify2(a, ACCESS_ALL_RW_RECORDER))
+ return 0;
+
+ if (strcmp(de->de_owner ?: "", a->aa_username ?: ""))
+ return -1;
+ return 0;
+}
+
/*
*
*/
/* Send all DVR entries */
LIST_FOREACH(de, &dvrentries, de_global_link)
if (!dvr_entry_verify(de, htsp->htsp_granted_access, 1) &&
- htsp_user_access_channel(htsp,de->de_channel))
+ htsp_user_access_channel(htsp, de->de_channel))
htsp_send_message(htsp, htsp_build_dvrentry(de, "dvrEntryAdd"), NULL);
/* Send EPG updates */
'profile,conn_limit,dvr,htsp_dvr,all_dvr,all_rw_dvr,' +
'dvr_config,channel_min,channel_max,channel_tag,comment';
+ var list2 = 'enabled,username,password,prefix,' +
+ 'webui,admin,' +
+ 'streaming,adv_streaming,htsp_streaming,' +
+ 'profile,conn_limit,dvr,htsp_dvr,all_dvr,all_rw_dvr,' +
+ 'failed_dvr,dvr_config,channel_min,channel_max,channel_tag,' +
+ 'comment';
+
tvheadend.idnode_grid(panel, {
url: 'api/access/entry',
titleS: 'Access Entry',
tabIndex: index,
edit: {
params: {
- list: list
+ list: list2
}
},
add: {
url: 'api/access/entry',
params: {
- list: list
+ list: list2
},
create: { }
},