Commit Graph

24 Commits

Author SHA1 Message Date
Roberto Rosario
0e86f2ad8a Refactor the model accesors
Refactor the accesors to behave like methods instead of properties.
This means all accesors will be prepended with the string
"get_" and will include a set of parenthesis.

Improve the ModeAttribute class to use the method's
short_description. This commit also adds support for a
new method .help_text attribute has been added.

Move accessors to their own module, named "methods.py".

Remove the PropertyHelper class as the accessors no longer
need it.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2018-12-15 04:49:40 -04:00
Roberto Rosario
15180e95bf Styling: Add keyword arguments to add_to_class usage
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2018-12-14 02:44:50 -04:00
Roberto Rosario
55a30379bd Various apps: Sort imports
Run imports as per Mayan EDMS best practices.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2018-12-06 01:57:24 -04:00
Michael Price
7db6bd3fc4 Use already available .get_for_class class method and avoid code repetition.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 02:41:33 -04:00
Roberto Rosario
56c4e841c5 Don't import ContentType directly but use apps.get_model instead.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-26 22:02:21 -04:00
Roberto Rosario
718a49437a Add get_classes method to the ModelPermission class.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-26 01:58:56 -04:00
Roberto Rosario
3cbe90567f Add method to grant and revoke access via ACLs.
Granting will also check if the permission has been
authorized to the object class using ModelPermission.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-17 20:39:41 -04:00
Roberto Rosario
63682a2945 Merge remote-tracking branch 'origin/master' into feature/master_merge
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-03-14 15:57:38 -04:00
Roberto Rosario
858eb8b020 Add writable ACLs API endpoints.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-03-13 21:04:12 -04:00
Roberto Rosario
e3f9dd9d20 Add a generic relation to any model that registers itself for ACLs.
This helps reference the ACLs of the model with using ContentType.
2017-02-19 02:34:17 -04:00
Roberto Rosario
2328355754 Don't error out when inspecting ACL permissions for an object with no registered permissions. 2016-03-19 02:20:36 -04:00
Roberto Rosario
66a49c8335 Don't assume all object have a proxy access accessor. 2016-03-18 20:57:39 -04:00
Roberto Rosario
a7faf7f427 Implement per document type document creation permission. Closes GitLab issue #232. 2016-03-08 03:39:23 -04:00
Roberto Rosario
27d8644438 Silence 90% of remaining Django 1.8 model warnings. 2016-01-28 05:43:08 -04:00
Roberto Rosario
bc3eed143c Add permission inheritance by parent object. Add ACLs app model tests. 2015-07-10 01:40:21 -04:00
Roberto Rosario
2d710ad3b9 Fix chicken & egg problem for permissions when the dataset doesn't exists. 2015-07-08 03:52:15 -04:00
Roberto Rosario
ee1b05fb57 Refactor code to associate a model with a set of permissions. Update related apps. 2015-06-30 22:00:14 -04:00
Roberto Rosario
070c3b648c Refactor acls app 2015-06-30 02:38:22 -04:00
Roberto Rosario
5be41af1cf Remove DefaultAccessControlList support 2015-06-29 14:51:37 -04:00
Roberto Rosario
ce5bf90c78 Add missing unicode literal import 2015-01-24 02:37:02 -04:00
Roberto Rosario
d59ea3ede2 Add from __future__ import unicode_literals, issue #37 2015-01-19 04:06:40 -04:00
Roberto Rosario
0cb9a78df4 Remove blind capitalization of messages 2014-09-13 01:24:39 -04:00
Roberto Rosario
6e293dd15c Remove remarked code 2014-09-11 13:00:06 -04:00
Roberto Rosario
ec1745b50b Initial changes to support the new Django 1.6 project structure 2014-06-15 13:13:21 +02:00