diff --git a/UPGRADING.md b/UPGRADING.md index c22ac8ee..d836e6ac 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -28,10 +28,16 @@ New permissions are available. If you configured custom permissions in `local.ya - `view_tag` - view all tags - `delete_tag` - delete tags - `edit_exported_timesheet` - allows to edit records which were exported +- `role_permissions` - view calculated permissions for user roles + +Removed permission: +- `system_actions` - removed experimental feature to flush your cache from the about screen ### BC BREAKS - API: Format for queries including a datetime object fixed, finally using the HTML5 format (previously `2019-03-02 14:23` - now `2019-03-02T14:23:00`) +- **Permission config**: the `permissions` definition in your `local.yaml` needs to be verified/changed, as the internal structure was highly optimized to simplify the definition. +Thanks to the new structure, you should be able to remove almost everything from your `local.yaml`: please read [the updated permission docu](https://www.kimai.org/documentation/permissions.html). ## [0.9](https://github.com/kevinpapst/kimai2/releases/tag/0.9) diff --git a/assets/js/plugins/KimaiAPILink.js b/assets/js/plugins/KimaiAPILink.js index 4fd3ea90..406e1441 100644 --- a/assets/js/plugins/KimaiAPILink.js +++ b/assets/js/plugins/KimaiAPILink.js @@ -39,8 +39,10 @@ export default class KimaiAPILink extends KimaiClickHandlerReducedInTableRow { } if (attributes.question !== undefined) { - self.getContainer().getPlugin('alert').question(attributes.question, function() { - self._callApi(url, attributes); + self.getContainer().getPlugin('alert').question(attributes.question, function(value) { + if (value) { + self._callApi(url, attributes); + } }); } else { self._callApi(url, attributes); diff --git a/assets/js/plugins/KimaiAlert.js b/assets/js/plugins/KimaiAlert.js index c6fb51d1..6b2527f8 100644 --- a/assets/js/plugins/KimaiAlert.js +++ b/assets/js/plugins/KimaiAlert.js @@ -41,8 +41,6 @@ export default class KimaiAlert extends KimaiPlugin { } Swal.fire({ - //toast: true, - //timer: 3000, timer: 1500, position: 'top-end', showConfirmButton: false, @@ -71,9 +69,7 @@ export default class KimaiAlert extends KimaiPlugin { confirmButtonText: translation.get('confirm'), cancelButtonText: translation.get('cancel') }).then((result) => { - if (result.value) { - callback(result.value); - } + callback(result.value); }); } diff --git a/config/packages/kimai.yaml b/config/packages/kimai.yaml index 521d131a..9648ac0b 100644 --- a/config/packages/kimai.yaml +++ b/config/packages/kimai.yaml @@ -75,34 +75,38 @@ kimai: # https://www.kimai.org/documentation/permissions.html # -------------------------------------------------------------------------------- permissions: + # mapping complex rule sets of single permissions to named "sets" ("set name" = [array of "permissions and sets"]) sets: - # mapping complex rule sets of single permissions to named "sets" ("set name" = [array of "permissions"]) - ACTIVITIES: [view_activity,create_activity,edit_activity,delete_activity] - PROJECTS: [view_project,create_project,edit_project,delete_project] - CUSTOMERS: [view_customer,create_customer,edit_customer,delete_customer] - INVOICE: [view_invoice,create_invoice] - INVOICE_TEMPLATE: [view_invoice_template,create_invoice_template,edit_invoice_template,delete_invoice_template] - TIMESHEET: [view_own_timesheet,start_own_timesheet,stop_own_timesheet,create_own_timesheet,edit_own_timesheet,export_own_timesheet,delete_own_timesheet] - TIMESHEET_OTHER: [view_other_timesheet,start_other_timesheet,stop_other_timesheet,create_other_timesheet,edit_other_timesheet,export_other_timesheet,delete_other_timesheet] - PROFILE: [view_own_profile,edit_own_profile,password_own_profile,preferences_own_profile,api-token_own_profile] - PROFILE_OTHER: [view_other_profile,edit_other_profile,delete_other_profile,password_other_profile,roles_other_profile,preferences_other_profile,api-token_other_profile] - TAGS: [view_tag,delete_tag] - USER: [view_user,create_user,delete_user] - RATE: [view_rate_own_timesheet,edit_rate_own_timesheet] - RATE_OTHER: [view_rate_other_timesheet,edit_rate_other_timesheet] - EXPORT: [view_export,create_export,edit_export_own_timesheet,edit_export_other_timesheet] + ACTIVITIES: ['view_activity','create_activity','edit_activity','delete_activity'] + PROJECTS: ['view_project','create_project','edit_project','delete_project'] + CUSTOMERS: ['view_customer','create_customer','edit_customer','delete_customer'] + INVOICE: ['view_invoice','create_invoice'] + INVOICE_TEMPLATE: ['view_invoice_template','create_invoice_template','edit_invoice_template','delete_invoice_template'] + TIMESHEET: ['view_own_timesheet','start_own_timesheet','stop_own_timesheet','create_own_timesheet','edit_own_timesheet','export_own_timesheet','delete_own_timesheet'] + TIMESHEET_OTHER: ['view_other_timesheet','start_other_timesheet','stop_other_timesheet','create_other_timesheet','edit_other_timesheet','export_other_timesheet','delete_other_timesheet'] + PROFILE: ['view_own_profile','edit_own_profile','password_own_profile','preferences_own_profile','api-token_own_profile'] + PROFILE_OTHER: ['view_other_profile','edit_other_profile','delete_other_profile','password_other_profile','roles_other_profile','preferences_other_profile','api-token_other_profile'] + TAGS: ['view_tag','delete_tag'] + USER: ['view_user','create_user','delete_user','role_permissions'] + RATE: ['view_rate_own_timesheet','edit_rate_own_timesheet'] + RATE_OTHER: ['view_rate_other_timesheet','edit_rate_other_timesheet'] + EXPORT: ['view_export','create_export','edit_export_own_timesheet','edit_export_other_timesheet'] + ROLE_USER: ['@TIMESHEET','@PROFILE'] + ROLE_TEAMLEAD: ['@INVOICE','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@EXPORT','@TAGS','@INVOICE_TEMPLATE','!delete_invoice_template','view_rate_own_timesheet','view_rate_other_timesheet','hourly-rate_own_profile'] + ROLE_ADMIN: ['@ACTIVITIES','@PROJECTS','@CUSTOMERS','@INVOICE','@INVOICE_TEMPLATE','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@RATE','@RATE_OTHER','@EXPORT','@TAGS','hourly-rate_own_profile','edit_exported_timesheet'] + ROLE_SUPER_ADMIN: ['@ACTIVITIES','@PROJECTS','@CUSTOMERS','@INVOICE','@INVOICE_TEMPLATE','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@PROFILE_OTHER','@USER','@RATE','@RATE_OTHER','@EXPORT','@TAGS','hourly-rate_own_profile','hourly-rate_other_profile','delete_own_profile','roles_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet'] + # mapping "sets" or permissions to user roles ("role name" = [array of "set names"]) maps: - # mapping "sets" or permissions to user roles ("role name" = [array of "set names"]) - ROLE_USER: [TIMESHEET,PROFILE] - ROLE_TEAMLEAD: [INVOICE,TIMESHEET,TIMESHEET_OTHER,PROFILE,EXPORT,TAGS] - ROLE_ADMIN: [ACTIVITIES,PROJECTS,CUSTOMERS,INVOICE,INVOICE_TEMPLATE,TIMESHEET,TIMESHEET_OTHER,PROFILE,RATE,RATE_OTHER,EXPORT,TAGS] - ROLE_SUPER_ADMIN: [ACTIVITIES,PROJECTS,CUSTOMERS,INVOICE,INVOICE_TEMPLATE,TIMESHEET,TIMESHEET_OTHER,PROFILE,PROFILE_OTHER,USER,RATE,RATE_OTHER,EXPORT,TAGS] + ROLE_USER: ['ROLE_USER'] + ROLE_TEAMLEAD: ['ROLE_TEAMLEAD'] + ROLE_ADMIN: ['ROLE_ADMIN'] + ROLE_SUPER_ADMIN: ['ROLE_SUPER_ADMIN'] + # add or remove single permissions roles: - # adding single permissions to user roles, extending the definition from "sets" ("role name" = [array of "permissions"]) ROLE_USER: [] - ROLE_TEAMLEAD: [view_invoice_template,create_invoice_template,edit_invoice_template,view_rate_own_timesheet,view_rate_other_timesheet,hourly-rate_own_profile] - ROLE_ADMIN: [hourly-rate_own_profile,edit_exported_timesheet] - ROLE_SUPER_ADMIN: [hourly-rate_own_profile,hourly-rate_other_profile,delete_own_profile,roles_own_profile,system_information,system_actions,system_configuration,plugins,edit_exported_timesheet] + ROLE_TEAMLEAD: [] + ROLE_ADMIN: [] + ROLE_SUPER_ADMIN: [] # -------------------------------------------------------------------------------- diff --git a/public/build/app.js b/public/build/app.js index ff6040b2..c790dd59 100644 --- a/public/build/app.js +++ b/public/build/app.js @@ -69,12 +69,12 @@ if(void 0===t)throw new Error("AdminLTE requires jQuery");+function(t){"use stri * Released under the MIT license. * http://jquery.org/license */ -!function(a){o=[n("7t+N"),n("WLoA"),n("Up1f"),n("Nnp9"),n("DYUE"),n("UZ9c"),n("z1kw")],i=a,void 0!==(r="function"==typeof i?i.apply(e,o):i)&&(t.exports=r)}(function(t){return t.widget("ui.menu",{version:"1.12.1",defaultElement:"