mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-20 19:09:02 +00:00
feat: 应用授权增加Action动作控制
This commit is contained in:
26
apps/perms/migrations/0022_applicationpermission_actions.py
Normal file
26
apps/perms/migrations/0022_applicationpermission_actions.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 3.1.13 on 2021-12-20 06:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
ACTION_CONNECT = 1
|
||||
|
||||
|
||||
def migrate_app_perms_actions(apps, schema_editor):
|
||||
perm_model = apps.get_model("perms", "ApplicationPermission")
|
||||
perm_model.objects.all().update(actions=ACTION_CONNECT)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('perms', '0021_auto_20211105_1605'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='applicationpermission',
|
||||
name='actions',
|
||||
field=models.IntegerField(choices=[(255, 'All'), (1, 'Connect'), (2, 'Upload file'), (4, 'Download file'), (6, 'Upload download'), (8, 'Clipboard copy'), (16, 'Clipboard paste'), (24, 'Clipboard copy paste')], default=255, verbose_name='Actions'),
|
||||
),
|
||||
migrations.RunPython(migrate_app_perms_actions)
|
||||
]
|
Reference in New Issue
Block a user