simo 2.5.38__py3-none-any.whl → 2.5.40__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of simo might be problematic. Click here for more details.
- simo/core/__pycache__/api.cpython-38.pyc +0 -0
- simo/core/__pycache__/models.cpython-38.pyc +0 -0
- simo/core/__pycache__/permissions.cpython-38.pyc +0 -0
- simo/core/__pycache__/serializers.cpython-38.pyc +0 -0
- simo/core/api.py +5 -6
- simo/core/models.py +11 -14
- simo/core/permissions.py +1 -1
- simo/core/serializers.py +7 -8
- simo/users/__pycache__/models.cpython-38.pyc +0 -0
- simo/users/models.py +0 -17
- {simo-2.5.38.dist-info → simo-2.5.40.dist-info}/METADATA +1 -1
- {simo-2.5.38.dist-info → simo-2.5.40.dist-info}/RECORD +16 -16
- {simo-2.5.38.dist-info → simo-2.5.40.dist-info}/LICENSE.md +0 -0
- {simo-2.5.38.dist-info → simo-2.5.40.dist-info}/WHEEL +0 -0
- {simo-2.5.38.dist-info → simo-2.5.40.dist-info}/entry_points.txt +0 -0
- {simo-2.5.38.dist-info → simo-2.5.40.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
simo/core/api.py
CHANGED
|
@@ -318,12 +318,11 @@ class ComponentHistoryViewSet(InstanceMixin, viewsets.ReadOnlyModelViewSet):
|
|
|
318
318
|
)
|
|
319
319
|
if self.request.user.is_superuser:
|
|
320
320
|
return qs
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
]
|
|
321
|
+
role = self.request.user.get_role(self.instance)
|
|
322
|
+
c_ids = []
|
|
323
|
+
for p in role.component_permissions.all():
|
|
324
|
+
if p.read:
|
|
325
|
+
c_ids.append(p.component.id)
|
|
327
326
|
qs = qs.filter(component__id__in=c_ids)
|
|
328
327
|
return qs
|
|
329
328
|
|
simo/core/models.py
CHANGED
|
@@ -580,22 +580,19 @@ def is_in_alarm(self):
|
|
|
580
580
|
return bool(self.value)
|
|
581
581
|
|
|
582
582
|
def can_read(self, user):
|
|
583
|
-
if user.
|
|
583
|
+
if user.is_master:
|
|
584
584
|
return True
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
from .middleware import get_current_instance
|
|
586
|
+
instance = get_current_instance()
|
|
587
|
+
if instance:
|
|
588
|
+
role = user.get_role(instance)
|
|
589
|
+
if not role:
|
|
590
|
+
return False
|
|
591
|
+
for perm in role.component_permissions.all():
|
|
592
|
+
if perm.component.id == self.id:
|
|
593
|
+
return any([perm.write, perm.read])
|
|
587
594
|
return False
|
|
588
|
-
|
|
589
|
-
return True
|
|
590
|
-
return perm.read
|
|
591
|
-
|
|
592
|
-
def can_write(self, user):
|
|
593
|
-
if user.is_superuser:
|
|
594
|
-
return True
|
|
595
|
-
perm = user.component_permissions.filter(component=self).first()
|
|
596
|
-
if not perm:
|
|
597
|
-
return False
|
|
598
|
-
return perm.write
|
|
595
|
+
return False
|
|
599
596
|
|
|
600
597
|
def get_controller_methods(self):
|
|
601
598
|
c_methods = []
|
simo/core/permissions.py
CHANGED
simo/core/serializers.py
CHANGED
|
@@ -531,9 +531,9 @@ class ComponentSerializer(FormSerializer):
|
|
|
531
531
|
if not role:
|
|
532
532
|
return True
|
|
533
533
|
for perm in role.component_permissions.all(): # prefetched
|
|
534
|
-
if perm == obj:
|
|
534
|
+
if perm.component.id == obj.id:
|
|
535
535
|
return not perm.write
|
|
536
|
-
return
|
|
536
|
+
return False
|
|
537
537
|
|
|
538
538
|
|
|
539
539
|
def get_app_widget(self, obj):
|
|
@@ -565,12 +565,11 @@ class ZoneSerializer(serializers.ModelSerializer):
|
|
|
565
565
|
return qs
|
|
566
566
|
user = self.context.get('request').user
|
|
567
567
|
instance = self.context.get('instance')
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
]
|
|
568
|
+
role = user.get_role(instance)
|
|
569
|
+
c_ids = []
|
|
570
|
+
for p in role.component_permissions.all():
|
|
571
|
+
if p.read:
|
|
572
|
+
c_ids.append(p.component.id)
|
|
574
573
|
qs = qs.filter(id__in=c_ids)
|
|
575
574
|
return qs
|
|
576
575
|
|
|
Binary file
|
simo/users/models.py
CHANGED
|
@@ -391,23 +391,6 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
391
391
|
def has_perms(self, perm_list, obj=None):
|
|
392
392
|
return True
|
|
393
393
|
|
|
394
|
-
def get_component_permissions(self):
|
|
395
|
-
if not self.instances:
|
|
396
|
-
return []
|
|
397
|
-
components = []
|
|
398
|
-
for instance in self.instances:
|
|
399
|
-
for comp in instance.components.all():
|
|
400
|
-
can_read = comp.can_read(self)
|
|
401
|
-
can_write = comp.can_write(self)
|
|
402
|
-
if not any([can_read, can_write]):
|
|
403
|
-
continue
|
|
404
|
-
components.append({
|
|
405
|
-
'component': comp,
|
|
406
|
-
'can_read': can_read,
|
|
407
|
-
'can_write': can_write
|
|
408
|
-
})
|
|
409
|
-
return components
|
|
410
|
-
|
|
411
394
|
|
|
412
395
|
class Fingerprint(models.Model):
|
|
413
396
|
value = models.CharField(max_length=200, db_index=True, unique=True)
|
|
@@ -33,7 +33,7 @@ simo/backups/migrations/__pycache__/0004_alter_backup_options_alter_backuplog_op
|
|
|
33
33
|
simo/backups/migrations/__pycache__/__init__.cpython-38.pyc,sha256=Lz1fs6V05h2AoxTOLNye0do9bEMnyuaXB_hHOjG5-HU,172
|
|
34
34
|
simo/core/__init__.py,sha256=_s2TjJfQImsMrTIxqLAx9AZie1Ojmm6sCHASdl3WLGU,50
|
|
35
35
|
simo/core/admin.py,sha256=T-NjMq1OxtCt-LjWL-YuuGtAi4JcvtjWhcGrLb8G5D4,18434
|
|
36
|
-
simo/core/api.py,sha256=
|
|
36
|
+
simo/core/api.py,sha256=7qaj5RtA5LFbe5NR-oPXO2pLQ_ohyGx-_-rf5j83vSw,28479
|
|
37
37
|
simo/core/api_auth.py,sha256=vCxvczA8aWNcW0VyKs5WlC_ytlqeGP_H_hkKUNVkCwM,1247
|
|
38
38
|
simo/core/api_meta.py,sha256=EaiY-dCADP__9MvLpoHvhjytFT92IrxPZDv95xgqasU,4955
|
|
39
39
|
simo/core/app_widgets.py,sha256=VxZzapuc-a29wBH7JzpvNF2SK1ECrgNUySId5ke1ffc,2509
|
|
@@ -52,10 +52,10 @@ simo/core/gateways.py,sha256=m0eS3XjVe34Dge6xtoCq16kFWCKJcdQrT0JW0REqoq8,3715
|
|
|
52
52
|
simo/core/loggers.py,sha256=EBdq23gTQScVfQVH-xeP90-wII2DQFDjoROAW6ggUP4,1645
|
|
53
53
|
simo/core/managers.py,sha256=n-b3I4uXzfHKTeB1VMjSaMsDUxp8FegFJwnbV1IsWQ4,3019
|
|
54
54
|
simo/core/middleware.py,sha256=eUFf6iP-Snx_0TE3MoXsSwqrd5IjlukqZk2GQGStRCo,3385
|
|
55
|
-
simo/core/models.py,sha256=
|
|
56
|
-
simo/core/permissions.py,sha256=
|
|
55
|
+
simo/core/models.py,sha256=QNVTnWeHAW6LVrs3eaR7WNMhwjICuQpXZ8vyH_2qCBo,22834
|
|
56
|
+
simo/core/permissions.py,sha256=V47wzxjbEFfp5JUCD7_T4BQfDOFgcNqJcqmiItkEQsU,3008
|
|
57
57
|
simo/core/routing.py,sha256=X1_IHxyA-_Q7hw1udDoviVP4_FSBDl8GYETTC2zWTbY,499
|
|
58
|
-
simo/core/serializers.py,sha256=
|
|
58
|
+
simo/core/serializers.py,sha256=Krnkov_Mmu9VMakoJbEB3HZDjMbd20pAdVUNFlNBoPg,21826
|
|
59
59
|
simo/core/signal_receivers.py,sha256=2WfF3FI5ZmJM1S-oT_1w3TdnBUX6fjbI4Rpg-DKsuYA,8696
|
|
60
60
|
simo/core/socket_consumers.py,sha256=trRZvBGTJ7xIbfdmVvn7zoiWp_qssSkMZykDrI5YQyE,9783
|
|
61
61
|
simo/core/storage.py,sha256=_5igjaoWZAiExGWFEJMElxUw55DzJG1jqFty33xe8BE,342
|
|
@@ -66,7 +66,7 @@ simo/core/views.py,sha256=yx9I0byeVUa-LAOnklpWIYwpNNOf5m9fyjKBvj4YCh4,2475
|
|
|
66
66
|
simo/core/widgets.py,sha256=J9e06C6I22F6xKic3VMgG7WeX07glAcl-4bF2Mg180A,2827
|
|
67
67
|
simo/core/__pycache__/__init__.cpython-38.pyc,sha256=ZJFM_XN0RmJMULQulgA_wFiOnEtsMoedcOWnXjH-Y8o,208
|
|
68
68
|
simo/core/__pycache__/admin.cpython-38.pyc,sha256=mXU-u9Bl5RCa0K4Y9wJAkYns33XCByME3sb_FsMC2DI,14090
|
|
69
|
-
simo/core/__pycache__/api.cpython-38.pyc,sha256=
|
|
69
|
+
simo/core/__pycache__/api.cpython-38.pyc,sha256=2OVjqi3noPxW9y8yEPKcKfS4Jpxk437neASU2Ws8-dE,21836
|
|
70
70
|
simo/core/__pycache__/api_auth.cpython-38.pyc,sha256=mi3mu5qEKio_PvfQEvr3Q6AhdPLAHxzxAxrMbAz_pKU,1712
|
|
71
71
|
simo/core/__pycache__/api_meta.cpython-38.pyc,sha256=VYx5ZeDyNBI4B_CBEIhV5B3GnLsMOx9s3rNZTSMODco,3703
|
|
72
72
|
simo/core/__pycache__/app_widgets.cpython-38.pyc,sha256=oN657XMMZ6GYN9nblv7fX3kdnTEzSP9XV6PXM6Z0wl4,4358
|
|
@@ -85,10 +85,10 @@ simo/core/__pycache__/gateways.cpython-38.pyc,sha256=D1ooHL-iSpQrxnD8uAl4xWFJmm-
|
|
|
85
85
|
simo/core/__pycache__/loggers.cpython-38.pyc,sha256=Z-cdQnC6XlIonPV4Sl4E52tP4NMEdPAiHK0cFaIL7I8,1623
|
|
86
86
|
simo/core/__pycache__/managers.cpython-38.pyc,sha256=6RTIxyjOgpQGtAqcUyE2vFPS09w1V5Wmd_vOV7rHRRI,3370
|
|
87
87
|
simo/core/__pycache__/middleware.cpython-38.pyc,sha256=g3d4L2PwxFyRKIPMP9Hkdjk1PL9NarQd4hSHS55I8n8,2649
|
|
88
|
-
simo/core/__pycache__/models.cpython-38.pyc,sha256=
|
|
89
|
-
simo/core/__pycache__/permissions.cpython-38.pyc,sha256=
|
|
88
|
+
simo/core/__pycache__/models.cpython-38.pyc,sha256=jLZXRDsR1_GJBvuDZ32KpuFz3B5qRoQmgpY6kLxxFI0,18554
|
|
89
|
+
simo/core/__pycache__/permissions.cpython-38.pyc,sha256=cPBxpwmxEWbcwznNobVlBffo2DttT6YJ6ZFMOkEHpfs,2982
|
|
90
90
|
simo/core/__pycache__/routing.cpython-38.pyc,sha256=3T3FPJ8Cn99xZCGvMyg2xjl7al-Shm9CelbSpkJtNP8,599
|
|
91
|
-
simo/core/__pycache__/serializers.cpython-38.pyc,sha256=
|
|
91
|
+
simo/core/__pycache__/serializers.cpython-38.pyc,sha256=sZx1gCy-0bdi0tZ5NatK7yGUcpI-d-T7o_mvhUpuOHM,19424
|
|
92
92
|
simo/core/__pycache__/signal_receivers.cpython-38.pyc,sha256=Od1ejof2nHAFzTAG5vGGVjMA8WUJNVJ9o_KWGqRSR34,6669
|
|
93
93
|
simo/core/__pycache__/socket_consumers.cpython-38.pyc,sha256=KqbO1cOewodVPcy0-htVefyUjCuELKV0o7fOfYqfgPc,8490
|
|
94
94
|
simo/core/__pycache__/storage.cpython-38.pyc,sha256=9R1Xu0FJDflfRXUPsqEgt0SpwiP7FGk7HaR8s8XRyI8,721
|
|
@@ -10456,7 +10456,7 @@ simo/users/auto_urls.py,sha256=lcJvteBsbHQMJieZpDz-63tDYejLApqsW3CUnDakd7k,272
|
|
|
10456
10456
|
simo/users/dynamic_settings.py,sha256=sEIsi4yJw3kH46Jq_aOkSuK7QTfQACGUE-lkyBogCaM,570
|
|
10457
10457
|
simo/users/managers.py,sha256=OHgEP85MBtdkdYxdstBd8RavTBT8F_2WyDxUJ9aCqqM,246
|
|
10458
10458
|
simo/users/middleware.py,sha256=GMCrnWSc_2qCleyQIkfQGdL-pU-UTEcSg1wPvIKZ9uk,1210
|
|
10459
|
-
simo/users/models.py,sha256=
|
|
10459
|
+
simo/users/models.py,sha256=2xQetyY9Mw6b7CidOC1IUd_Hc_ZgUGvqqgTpDxffnNI,19144
|
|
10460
10460
|
simo/users/permissions.py,sha256=IwtYS8yQdupWbYKR9VimSRDV3qCJ2jXP57Lyjpb2EQM,242
|
|
10461
10461
|
simo/users/serializers.py,sha256=zzw1KONTnaTNBaU0r4rNVxJ827KzD6Z5LuQt27ZsQ98,2516
|
|
10462
10462
|
simo/users/sso_urls.py,sha256=gQOaPvGMYFD0NCVSwyoWO-mTEHe5j9sbzV_RK7kdvp0,251
|
|
@@ -10473,7 +10473,7 @@ simo/users/__pycache__/auto_urls.cpython-38.pyc,sha256=K-3sz2h-cEitoflSmZk1t0eUg
|
|
|
10473
10473
|
simo/users/__pycache__/dynamic_settings.cpython-38.pyc,sha256=6F8JBjZkHykySnmZjNEzjS0ijbmPdcp9yUAZ5kqq_Fo,864
|
|
10474
10474
|
simo/users/__pycache__/managers.cpython-38.pyc,sha256=O0Y8ABp42RAosrbODmYsPMaj9AyOPyJ-aqzuO0Qpi2s,679
|
|
10475
10475
|
simo/users/__pycache__/middleware.cpython-38.pyc,sha256=Tj4nVEAvxEW3xA63fBRiJWRJpz_M848ZOqbHioc_IPE,1149
|
|
10476
|
-
simo/users/__pycache__/models.cpython-38.pyc,sha256=
|
|
10476
|
+
simo/users/__pycache__/models.cpython-38.pyc,sha256=NlcBNkYjDv_1BE60uA8iHrQEl1xBvXZFnU-MZisl0qw,17344
|
|
10477
10477
|
simo/users/__pycache__/permissions.cpython-38.pyc,sha256=ez5NxoL_JUeeH6GsKhvFreuA3FCBgGf9floSypdXUtM,633
|
|
10478
10478
|
simo/users/__pycache__/serializers.cpython-38.pyc,sha256=Dy8RAcwNkNSXoJHvLp8fozURyHCtucqpSPyqZtbnMZc,3732
|
|
10479
10479
|
simo/users/__pycache__/sso_urls.cpython-38.pyc,sha256=uAwDozpOmrhUald-8tOHANILXkH7-TI8fNYXOtPkSY8,402
|
|
@@ -10579,9 +10579,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10579
10579
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10580
10580
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10581
10581
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10582
|
-
simo-2.5.
|
|
10583
|
-
simo-2.5.
|
|
10584
|
-
simo-2.5.
|
|
10585
|
-
simo-2.5.
|
|
10586
|
-
simo-2.5.
|
|
10587
|
-
simo-2.5.
|
|
10582
|
+
simo-2.5.40.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10583
|
+
simo-2.5.40.dist-info/METADATA,sha256=PEe6jttMZzUykEGtSSMfd-mmaTTeG-DXGylAHEkaEzI,1953
|
|
10584
|
+
simo-2.5.40.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
10585
|
+
simo-2.5.40.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
|
|
10586
|
+
simo-2.5.40.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10587
|
+
simo-2.5.40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|