[Update] 资产授权序列类is_expired, is_valid设置为read_only

pull/4019/head
Bai 5 years ago
parent f9e167cb0e
commit 75f4f6d0a2

@ -36,14 +36,14 @@ class ActionsDisplayField(ActionsField):
class AssetPermissionSerializer(BulkOrgResourceModelSerializer): class AssetPermissionSerializer(BulkOrgResourceModelSerializer):
actions = ActionsField(required=False, allow_null=True) actions = ActionsField(required=False, allow_null=True)
is_valid = serializers.BooleanField() is_valid = serializers.BooleanField(read_only=True)
is_expired = serializers.BooleanField() is_expired = serializers.BooleanField(read_only=True)
class Meta: class Meta:
model = AssetPermission model = AssetPermission
mini_fields = ['id', 'name'] mini_fields = ['id', 'name']
small_fields = mini_fields + [ small_fields = mini_fields + [
'is_active', 'actions', 'created_by', 'date_created' 'is_active', 'is_expired', 'is_valid', 'actions', 'created_by', 'date_created'
] ]
m2m_fields = [ m2m_fields = [
'users', 'user_groups', 'assets', 'nodes', 'system_users', 'users', 'user_groups', 'assets', 'nodes', 'system_users',

Loading…
Cancel
Save