diff --git a/cps/constants.py b/cps/constants.py index ef207e02..ffaa5a2f 100644 --- a/cps/constants.py +++ b/cps/constants.py @@ -68,6 +68,7 @@ ROLE_ANONYMOUS = 1 << 5 ROLE_EDIT_SHELFS = 1 << 6 ROLE_DELETE_BOOKS = 1 << 7 ROLE_VIEWER = 1 << 8 +ROLE_SEND_TO_EREADER = 1 << 9 ALL_ROLES = { "admin_role": ROLE_ADMIN, @@ -78,6 +79,7 @@ ALL_ROLES = { "edit_shelf_role": ROLE_EDIT_SHELFS, "delete_role": ROLE_DELETE_BOOKS, "viewer_role": ROLE_VIEWER, + "send_to_ereader": ROLE_SEND_TO_EREADER, } DETAIL_RANDOM = 1 << 0 diff --git a/cps/templates/admin.html b/cps/templates/admin.html index ac124fe8..4cb69e21 100644 --- a/cps/templates/admin.html +++ b/cps/templates/admin.html @@ -20,6 +20,7 @@ {{_('Upload')}} {% endif %} {{_('Download')}} + {{_('Send to eReader')}} {{_('View Books')}} {{_('Edit')}} {{_('Delete')}} @@ -38,6 +39,7 @@ {{ display_bool_setting(user.role_upload()) }} {% endif %} {{ display_bool_setting(user.role_download()) }} + {{ display_bool_setting(user.role_send_to_ereader()) }} {{ display_bool_setting(user.role_viewer()) }} {{ display_bool_setting(user.role_edit()) }} {{ display_bool_setting(user.role_delete_books()) }} diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 840d2f75..43718141 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -43,6 +43,8 @@ {% endif %} {% endif %} + {% endif %} + {% if current_user.role_send_to_ereader() %} {% if current_user.kindle_mail and entry.email_share_list %} {% if entry.email_share_list.__len__() == 1 %} diff --git a/cps/ub.py b/cps/ub.py index 3e478f99..909bfc06 100644 --- a/cps/ub.py +++ b/cps/ub.py @@ -160,6 +160,9 @@ class UserBase: def role_viewer(self): return self._has_role(constants.ROLE_VIEWER) + def role_send_to_ereader(self): + return self._has_role(constants.ROLE_SEND_TO_EREADER) + @property def is_active(self): return True