mirror of
https://github.com/janeczku/calibre-web
synced 2024-06-18 11:19:57 +00:00
Merge bf014e5b63
into becb84a73d
This commit is contained in:
commit
ac67534b68
|
@ -68,6 +68,7 @@ ROLE_ANONYMOUS = 1 << 5
|
||||||
ROLE_EDIT_SHELFS = 1 << 6
|
ROLE_EDIT_SHELFS = 1 << 6
|
||||||
ROLE_DELETE_BOOKS = 1 << 7
|
ROLE_DELETE_BOOKS = 1 << 7
|
||||||
ROLE_VIEWER = 1 << 8
|
ROLE_VIEWER = 1 << 8
|
||||||
|
ROLE_SEND_TO_EREADER = 1 << 9
|
||||||
|
|
||||||
ALL_ROLES = {
|
ALL_ROLES = {
|
||||||
"admin_role": ROLE_ADMIN,
|
"admin_role": ROLE_ADMIN,
|
||||||
|
@ -78,6 +79,7 @@ ALL_ROLES = {
|
||||||
"edit_shelf_role": ROLE_EDIT_SHELFS,
|
"edit_shelf_role": ROLE_EDIT_SHELFS,
|
||||||
"delete_role": ROLE_DELETE_BOOKS,
|
"delete_role": ROLE_DELETE_BOOKS,
|
||||||
"viewer_role": ROLE_VIEWER,
|
"viewer_role": ROLE_VIEWER,
|
||||||
|
"send_to_ereader": ROLE_SEND_TO_EREADER,
|
||||||
}
|
}
|
||||||
|
|
||||||
DETAIL_RANDOM = 1 << 0
|
DETAIL_RANDOM = 1 << 0
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<th class="hidden-xs hidden-sm">{{_('Upload')}}</th>
|
<th class="hidden-xs hidden-sm">{{_('Upload')}}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th class="hidden-xs hidden-sm">{{_('Download')}}</th>
|
<th class="hidden-xs hidden-sm">{{_('Download')}}</th>
|
||||||
|
<th class="hidden-xs hidden-sm">{{_('Send to eReader')}}</th>
|
||||||
<th class="hidden-xs hidden-sm hidden-md">{{_('View Books')}}</th>
|
<th class="hidden-xs hidden-sm hidden-md">{{_('View Books')}}</th>
|
||||||
<th class="hidden-xs hidden-sm hidden-md">{{_('Edit')}}</th>
|
<th class="hidden-xs hidden-sm hidden-md">{{_('Edit')}}</th>
|
||||||
<th class="hidden-xs hidden-sm hidden-md">{{_('Delete')}}</th>
|
<th class="hidden-xs hidden-sm hidden-md">{{_('Delete')}}</th>
|
||||||
|
@ -38,6 +39,7 @@
|
||||||
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td>
|
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_download()) }}</td>
|
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_download()) }}</td>
|
||||||
|
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_send_to_ereader()) }}</td>
|
||||||
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_viewer()) }}</td>
|
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_viewer()) }}</td>
|
||||||
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_edit()) }}</td>
|
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_edit()) }}</td>
|
||||||
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_delete_books()) }}</td>
|
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_delete_books()) }}</td>
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if current_user.role_send_to_ereader() %}
|
||||||
{% if current_user.kindle_mail and entry.email_share_list %}
|
{% if current_user.kindle_mail and entry.email_share_list %}
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
{% if entry.email_share_list.__len__() == 1 %}
|
{% if entry.email_share_list.__len__() == 1 %}
|
||||||
|
|
|
@ -160,6 +160,9 @@ class UserBase:
|
||||||
def role_viewer(self):
|
def role_viewer(self):
|
||||||
return self._has_role(constants.ROLE_VIEWER)
|
return self._has_role(constants.ROLE_VIEWER)
|
||||||
|
|
||||||
|
def role_send_to_ereader(self):
|
||||||
|
return self._has_role(constants.ROLE_SEND_TO_EREADER)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user