Commit graph

119 commits

Author SHA1 Message Date
Ankush Menat
8446875257
refactor!: Remove "Set user permission" permtype (#20090)
This has never worked and setting user permission requires system
manager role always (because of permissions on list view)
2023-02-20 16:07:49 +05:30
Ankush Menat
b55bbd0a8c
fix(UX): Sort case-insensitive where it makes sense (#20088) 2023-02-20 13:07:32 +05:30
Raffael Meyer
09d35c74eb
fix: remove redundant translation (#18775) 2022-11-06 17:27:02 +05:30
Ankush Menat
40f27f908a style: format JS files with prettier 2022-08-04 14:51:01 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
084a1e6c31 refactor: get_permissions
* Show page even if dangling Custom DocPerm records encountered
* Add typing hints
* Cleanup APIs
2022-06-27 15:18:06 +05:30
Suraj Shetty
5db7716df2
Merge pull request #17223 from frappe/rpm_typo 2022-06-16 16:20:27 +05:30
Michelle Alva
86f9465432
chore: typo 2022-06-16 16:16:00 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
smehata
6cbede451d
fix(Permission Manager): Update client-side permission data (#15945)
On updating access from Permission Manager. Permissions are not updated till we do a hard refresh.
![Screenshot from 2022-02-11 12-32-52](https://user-images.githubusercontent.com/53169014/153550692-dc530eec-f44e-497d-9aca-8c10f1819cb0.png)
2022-02-16 04:42:35 +00:00
Sagar Vora
a1ddd25dff fix: unable to delete role permissions 2021-10-08 15:36:58 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
dfccae5246 perf(minor): Permission Manager remove API
Delete using the filters directly instead of selecting rows in one query
and deleting those rows in another. DBMS would have to scan the table
twice prior
2021-07-28 19:05:27 +05:30
Aradhya-Tripathi
84ff1d0af9 style: removed frappe.db.sql comments 2021-07-28 13:48:01 +05:30
Aradhya-Tripathi
fa6cb14ee5 refactor: moved from raw queries to frappe orm in
core
2021-07-21 19:15:38 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Rohit Waghchaure
112784e7ae feat: custom user type with doctypes 2021-04-01 13:54:11 +05:30
prssanna
b95311728a style: fix formatting 2021-01-29 16:34:35 +05:30
Suraj Shetty
a2207d1174 style: Fix formatting issue 2021-01-29 15:58:29 +05:30
Suraj Shetty
21c020e036 style: Fix formatting issues 2021-01-29 15:43:11 +05:30
Suraj Shetty
b94d5778a8 Merge branch 'develop' of https://github.com/frappe/frappe into rebrand-ui 2021-01-19 10:36:50 +05:30
Shivam Mishra
53eda718b6
Merge pull request #12078 from scmmishra/permission-alert-flag 2021-01-06 12:51:17 +05:30
Saurabh
97b693c6b0
feat: Added permission to grant only Select access to document (#12063)
* feat: add permtype 'select' to DocPerm and CustomDocPerm

* feat: add 'select' perm in rights tupple

* feat: provisions to handle select permission

* feat: toggle href based on permissions

* feat: pass permission type explicitly while validating link in permission check

* fix: sider

* feat: added test cases to validate select perm

* feat: add method frappe.only_has_select_perm to explicitly check the select perm

* fix: if user only has select perm then do not show anchor tag for link fields

* fix: sider
2020-12-29 16:58:28 +05:30
Rushabh Mehta
54cee87826 fix(minor): tests + routing 2020-12-24 14:48:40 +05:30
Shivam Mishra
424c0c50f8 fix: set alert flag to false by default 2020-12-23 13:50:18 +05:30
Shivam Mishra
568426668f feat: add alert flag for permission validation
In case default permissions are not set, the alert flag will indicate if an alert has to be shown in the UI or not
2020-12-11 13:55:31 +05:30
Rushabh Mehta
75fe8a615a feat(app): move /desk to /app 2020-11-11 16:31:47 +05:30
Shivam Mishra
7a6b112bd6 fix: perm manager remove button 2020-10-19 14:42:41 +05:30
Shivam Mishra
42d97f84a2 feat: manage primary and secondary action lifecycle 2020-10-13 19:46:42 +05:30
Shivam Mishra
c0f8e698fb feat: refactor role perm manager
* New design
* Use modern constructor
* remove me = this hack
* replace $.each with forEach
* formatting fixes
2020-10-13 19:40:24 +05:30
Shivam Mishra
46df186833 chore: remove style 2020-10-13 19:40:24 +05:30
Shivam Mishra
65165b6be6 fix: translation syntax 2020-08-24 13:09:20 +05:30
Shivam Mishra
2655a3f8dc feat: freeze dom on updating permissions 2020-08-19 12:49:40 +05:30
Michelle Alva
fc3195537d
fix: change tooltip document types to type
In Role Permissions Manager, the tooltip for document type shows document types. Changed it to document type
2020-04-27 18:09:31 +05:30
Deepesh Garg
18664430c4 fix: Do not show create, write and delete perm in role permission manager for doctypes with in_create property set 2020-03-28 21:06:56 +05:30
Chinmay Pai
5243c6fb01
chore: add missing return statement (#8340)
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2019-09-04 18:40:17 +05:30
Suraj Shetty
aee7c67f8b refactor: Move get_users_with_role to utils.user 2019-03-21 21:06:54 +05:30
Nabin Hait
c3877bf056 Reset standard json after migrating customisations to custom layer 2018-06-28 13:25:56 +05:30
Suraj Shetty
c71c132ba2 Workflow actions (#5598)
* Init workflow actions

- WIP code
- Add hooks to create and update
workflow action on document status changes.
- Tweak listview to show host document on list view item click
- Add new doctype "Pending Workflow Action"
- Add allow_self_approval check in Workflow master

* Rename doctypes

- Rename "Workflow Action" to "Workflow Action Master"
- Rename "Pending Workflow Action" to "Workflow Action"
- Remove irrelevant files

* Clear old workflow action on docstatus change

- Add check for user permission before creating a workflow action record
- Make doctype changes to support the Workflow Action  System

* Show host document only if workflow action status is open

* Send workflow action mail notifications

* Add patch to rename `tabWorkflow Action` to `tab Workflow Master`

- Rename table to retain data in `tabWorkflow Action` as it
will be overwritten with new structure on migration

* Enqueue email

* Remove unused files

* Add hook for custom has_permission

* Optimize send_workflow_action_email method

* Add permission_query_condition hook

* Show notification based on status

* Override get_form_link in list view

* Refactor workflow action

- Add action link
- update workflow action hooks

* Avoid repeated creation of Worklow Actions

- Update hooks entry to avoid unwanted method call

* Fix error with frappe.db.count usage

* Fix ui/ux for Workflow Action

- Fix action url and improve response on action button click
- Fix workflow action template style

* Fix Codacy

* Add self approval check

* Fix codacy

* Fix test

* Fix python version confilct and a permission error

* Fix incorrect 'this' reference

* Update with requested changes

* Add next action email template option

* Fix string formatting

* Refactor workflow Action

- Make process_workflow_action smaller

* Fix bugs and errors due to refactor

* Fix workflow field caching

* Add a workflow action test

* Fix bugs with email template
2018-05-30 11:24:49 +05:30
Suraj Shetty
a93bc87363 Permission fixes (#5530)
* Add User Permissions to Config module

* Update Permission Manager help

* Fix share button

* Remove user-permissions page

* Remove unnecessary error modals

* User Permission UI fixes
- Fix double multicheck bug on save
- Add margin above and below select all button

* Update user_permissions dict realtime on client side

- Remove user_permissions from boot

* Cast permission dict values to int
2018-05-04 19:49:11 +05:30
Saurabh
f3a25b3f91 Merge branch 'master' into develop 2018-05-02 14:51:46 +05:30
Zarrar
efa359e201 restore original permissions for standard and custom doctypes (#5498) 2018-04-30 11:29:05 +05:30
Rah Yuliantoro
d6902b5010 Update permission_manager_help.html (#5462)
translation tag
2018-04-20 12:26:15 +05:30
Suraj Shetty
ba91496378 Permission fixes (#5368)
* ui-fixes
- change help text
- remove if owner description and change label to Only If Creator
- adjust icon size (restricted list)
- add tags.less in build json

* remove block module for user check

* label change for module access
Rename module access section to desktop in user doctype to avoid confusion
2018-04-04 12:54:18 +05:30
Suraj Shetty
0be4342649 User permissions redux (#5314)
* [start] removing simpler user permission structure

* permission changes
removed "apply user permission" from has_permission

* test fixes and other supporting fixes

* Removed Apply user permission code

* additional check to see if user has some user permissions related to a doctype

* test fixes

* removed a test

* Permission changes
- Code to restrict access if module is blocked for user.
- [Fix] ignore user perm if applicable

* List view restrictions ui changes

* removed unwanted apply user perm code

* permission (block module fix)

* permission fix

* change user permission
user permission will not be applied if user doesn't have role permission

* removed left "apply_user_permissions" property

* add user permission help template

* perm js refactor

* ui / ux changes
restrict list view before entering view if user is not permitterd
add description for if owner check in role permission manager

* codacy fixes

* permission code fix
add controller permission check
add blocked module check in build_permission

* optimized get blocked module method
2018-04-03 10:42:04 +05:30
Charles-Henri Decultot
bf2936268b Transaction Log for France (#4974)
* Transaction Log creation

* Addition of tests

* Codacy corrections
2018-02-21 11:06:48 +05:30
rohitwaghchaure
7e7ecdb2ab [Fix] Submit option not visible in the role permisison manager (#4786) 2018-01-09 11:34:26 +05:30
Faris Ansari
e617dfbf98 Don't show submit, cancel, amend buttons for non submittable doctypes (#4448) 2017-11-10 14:21:06 +05:30
Makarand Bauskar
6e6fb684ec [hotfix] dont Patch Log, Module Def in Permission Manager (#4070) 2017-09-06 16:15:37 +05:30
Manas Solanki
899fe860d1 sorted the select in permission manager as per translated string 2017-08-28 11:38:46 +05:30