Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/field-types/control-access.js
module.exports = app => ({ | module.exports = app => ({ | ||||
name: "control-access", | name: "control-access", | ||||
is_proper_value: async function( | async is_proper_value( | ||||
context, | context, | ||||
{ target_field_type_name, target_params, target_access_strategies }, | { target_field_type_name, target_params, target_access_strategies }, | ||||
new_value, | new_value, | ||||
old_value | old_value | ||||
) { | ) { | ||||
const target_field_type = app.FieldType(target_field_type_name); | const target_field_type = app.FieldType(target_field_type_name); | ||||
const target_access_strategy = new app.Sealious.AccessStrategy( | const target_access_strategy = new app.Sealious.AccessStrategy( | ||||
Show All 14 Lines | ) { | ||||
return target_field_type.is_proper_value( | return target_field_type.is_proper_value( | ||||
context, | context, | ||||
target_params, | target_params, | ||||
new_value, | new_value, | ||||
old_value | old_value | ||||
); | ); | ||||
}, | }, | ||||
decode: function( | decode( | ||||
context, | context, | ||||
{ target_field_type_name, target_params, target_access_strategies }, | { target_field_type_name, target_params, target_access_strategies }, | ||||
value_in_db | value_in_db | ||||
) { | ) { | ||||
const target_access_strategy = new app.Sealious.AccessStrategy( | const target_access_strategy = new app.Sealious.AccessStrategy( | ||||
app, | app, | ||||
target_access_strategies.show | target_access_strategies.show | ||||
); | ); | ||||
Show All 18 Lines |