2016-04-10 35 views
1

Geridönüşte (Strongloop) bir modelin Model.json dosyasında belirtilen özellikler nelerdir?Model.json'daki özellikler

Model.json dosyasına hangi özelliklerin eklenebileceğini anlamaya çalışıyordum ancak dokümantasyonda çok az veriliyor.

cevap

0

Bazı yeni alanlar gibi - gizlenmiş, hiddenProperties, hiddenAPIProperties bu

{ 
    "name": "product", 
    "plural": "products", 
    "base": "persistedModel", 
"strict": true, 
    "properties": { 
    "id": { 
     "type": "text", 
     "required": true, 
     "access": "readOnly", 
     "readOnlyType": "auto" 
    }, 
    "created": { 
     "type": "text", 
     "required": true, 
     "access": "readOnly", 
     "readOnlyType": "createdTimestamp" 
    }, 
    "lastUpdated": { 
     "type": "text", 
     "required": true, 
     "access": "readOnly", 
     "readOnlyType": "updatedTimestamp" 
    }, 
    "requestIPAddress": { 
     "type": "text", 
     "required": true, 
     "access": "hidden" 
    }, 
    "name": { 
     "type": "text", 
     "required": true, 
    }, 
    "type": { 
     "type": "text", 
     "required": true 
    }, 
    "manufacturerId": { 
     "required": true 
    }, 
    "supplierId": { 
     "required": true 
    } 
    }, 
    "hidden": [], 
    "hiddenProperties": [], 
    "hiddenAPIProperties": [], 
    "validations": [], 
    "relations": { 
    "manufacturer": { 
     "type": "belongsTo", 
     "model": "manufacturer", 
     "foreignKey": "manufacturerId" 
    }, 
    "supplier": { 
     "type": "belongsTo", 
     "model": "supplier", 
     "foreignKey": "supplierId" 
    } 
    }, 
    "acls": [ 
    { 
     "accessType": "*", 
     "modelProperty": "manufacturerId" 
     "permission": "DENY", 
     "principalType": "ROLE", 
     "principalId": "$everyone" 
    }, 
    { 
     "accessType": "*", 
     "modelProperty": "supplierId" 
     "permission": "DENY", 
     "principalType": "ROLE", 
     "principalId": "$everyone" 
    }, 
    { 
     "property": "_READ_HIDDEN_PROPERTIES_", 
     "permission": "ALLOW", 
     "principalType": "ROLE", 
     "principalId": "admin" 
    }, 
    { 
     "property": "_WRITE_HIDDEN_PROPERTIES_", 
     "permission": "ALLOW", 
     "principalType": "ROLE", 
     "principalId": "admin" 
    }, 
    { 
     "accessType": "*", 
     "modelProperty": "manufacturerId" 
     "permission": "ALLOW", 
     "principalType": "ROLE", 
     "principalId": "admin" 
    }, 
    { 
     "accessType": "*", 
     "modelProperty": "supplierId" 
     "permission": "ALLOW", 
    "principalType": "ROLE", 
     "principalId": "admin" 
    }, 
    { 
     "accessType": "*", 
     "modelProperty": "manufacturerId" 
     "permission": "ALLOW", 
     "principalType": "ROLE", 
     "principalId": "productAdmin" 
    }, 
    { 
     "accessType": "*", 
     "modelProperty": "supplierId" 
     "permission": "ALLOW", 
     "principalType": "ROLE", 
     "principalId": "productAdmin" 
    } 
    ], 
    "methods": [] 
} 
bakmak ...... geri döngü belgelerinde belirtilmeyen model.json dosyasına eklenebilir