perf(perms): 应用授权表添加字段,type和category

This commit is contained in:
Bai
2020-10-28 12:14:14 +08:00
committed by 老广
parent 8fa15b3378
commit 77c8ca5863
3 changed files with 47 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ from django.utils.translation import ugettext_lazy as _
from common.utils import lazyproperty
from .base import BasePermission
from users.models import User
from applications.models import Category
__all__ = [
'ApplicationPermission',
@@ -15,6 +16,8 @@ __all__ = [
class ApplicationPermission(BasePermission):
category = models.CharField(max_length=16, choices=Category.choices, verbose_name=_('Category'))
type = models.CharField(max_length=16, choices=Category.get_all_type_choices(), verbose_name=_('Type'))
applications = models.ManyToManyField('applications.Application', related_name='granted_by_permissions', blank=True, verbose_name=_("Application"))
system_users = models.ManyToManyField('assets.SystemUser', related_name='granted_by_application_permissions', verbose_name=_("System user"))