----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/129983/#review102826 -----------------------------------------------------------
I'm not sure if we should show the warning dialog at the kio_file level. This would result in a double dialog when deleting files with Shift+Del from file managers. What about making jobuidelegate.cpp smarter? It could show a more "scary" message if the file that's being deleted is write-protected. - Elvis Angelaccio On March 9, 2017, 3:57 p.m., Chinmoy Ranjan Pradhan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/129983/ > ----------------------------------------------------------- > > (Updated March 9, 2017, 3:57 p.m.) > > > Review request for KDE Frameworks, David Faure and Elvis Angelaccio. > > > Repository: kio > > > Description > ------- > > This is regarding the GSOC idea > https://community.kde.org/GSoC/2017/Ideas#Project:_Polkit_support_in_KIO. > > This patch intends to demonstrate one possible approach to provide polkit > support in kio. Here its only for the delete operation. This is based on the > patch in task https://phabricator.kde.org/T5070. > > The approach is as follows; > 1. Whenever file ioslave gets access denied error it calls the method > *execWithRoot* with the action that requires priviledge, the path of items > upon which action needs to be performed and a warning ID as arguments. > 2. *execWithRoot* then executes the KAuth::Action *org.kde.kio.file.execute*. > 3. This Kauth::Action has its Persistence set too 'session'. This means that > after authentication the restrictions are dropped for a while, for > about 5 minutes. This is similar to the behaviour of sudo command. > 4. During this time we can perform any action as a privileged user without > any authentication. So to prevent any mishap i added a warning box which > would popup before performing any action(only during this period). > 5. After the said time interval the root privileges are droped and calling > *execWithRoot* should show the usual authentication dialog. > > > Diffs > ----- > > src/ioslaves/file/CMakeLists.txt b9132ce > src/ioslaves/file/file.h 109ea80 > src/ioslaves/file/file.cpp eaf6c88 > src/ioslaves/file/file_unix.cpp 82eb11a > src/ioslaves/file/kauth/CMakeLists.txt PRE-CREATION > src/ioslaves/file/kauth/file.actions PRE-CREATION > src/ioslaves/file/kauth/helper.h PRE-CREATION > src/ioslaves/file/kauth/helper.cpp PRE-CREATION > > Diff: https://git.reviewboard.kde.org/r/129983/diff/ > > > Testing > ------- > > > File Attachments > ---------------- > > warning dialog > > https://git.reviewboard.kde.org/media/uploaded/files/2017/03/09/d42570e8-aedf-4c02-801e-362a68755c2c__polkit_integration.png > > > Thanks, > > Chinmoy Ranjan Pradhan > >