mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-31 15:23:02 +00:00 
			
		
		
		
	Security fix improved: user should not edit other shelve's titles
This commit is contained in:
		| @@ -235,8 +235,9 @@ def create_shelf(): | |||||||
| @login_required | @login_required | ||||||
| def edit_shelf(shelf_id): | def edit_shelf(shelf_id): | ||||||
|     shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first() |     shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first() | ||||||
|     if not shelf.user_id == int(current_user.id): |     if not check_shelf_edit_permissions(shelf): | ||||||
|         return "Sorry you are not allowed to edit this shelf", 403 |         flash(_(u"Sorry you are not allowed to edit this shelf: "),category="error") | ||||||
|  |         return redirect(url_for('web.index')) | ||||||
|     return create_edit_shelf(shelf, title=_(u"Edit a shelf"), page="shelfedit", shelf_id=shelf_id) |     return create_edit_shelf(shelf, title=_(u"Edit a shelf"), page="shelfedit", shelf_id=shelf_id) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ileana Maricel Barrionuevo
					Ileana Maricel Barrionuevo