Available as req.SA everywhere
Properties:
Name | Type | Description |
---|---|---|
sequelizeInstance |
Object | Sequelize instance |
Sequelize |
Sequelize | sequelize constructor |
modelAdminManager |
Object | ModelAdminManager instance |
modelName |
String | current model name from url |
modelAdminInstance |
Object | ModelAdmin instance for current model |
PERMISSION |
Object | user session permissions |
utils |
Object | req.SA.utils |
- Source:
Namespaces
Methods
(static) checkPermission(req, action, modelName) → {Boolean}
Check user permission
Parameters:
Name | Type | Description |
---|---|---|
req |
Express.Request | |
action |
Number | |
modelName |
String |
- Source:
Returns:
- Type
- Boolean
(static) formExtender(extraParams, unsetParams) → {String}
Parameters:
Name | Type | Description |
---|---|---|
extraParams |
Object | new form params |
unsetParams |
Array | String | params to unset, false means unset all |
- Source:
Returns:
html, set of hidden form inputs with params
- Type
- String
(static) formExtender(extraParams, unsetParams) → {String}
Parameters:
Name | Type | Description |
---|---|---|
extraParams |
Object | new form params |
unsetParams |
Array | String | params to unset, false means unset all |
- Source:
Returns:
html, set of hidden form inputs with params
- Type
- String
(static) getSequelizeError(type, fieldName)
Get ValidationError
Parameters:
Name | Type | Description |
---|---|---|
type |
String | error type |
fieldName |
String | field name on which error occured |
- Source:
Throws:
Sequelize.ValidationError
(static) queryExtender(pathParts, extraParams, unsetParams) → {String}
Parameters:
Name | Type | Description |
---|---|---|
pathParts |
Array | url parts |
extraParams |
Object | new url params |
unsetParams |
Array | String | params to unset, false means unset all |
- Source:
Returns:
url
- Type
- String
(static) queryExtender(pathParts, extraParams, unsetParams) → {String}
Parameters:
Name | Type | Description |
---|---|---|
pathParts |
Array | url parts |
extraParams |
Object | new url params |
unsetParams |
Array | String | params to unset, false means unset all |
- Source:
Returns:
url
- Type
- String
(static) tr(message, default) → {String}
Translates message
Parameters:
Name | Type | Description |
---|---|---|
message |
String | |
default |
String |
- Source:
Returns:
- Type
- String
(static) trAction(actionName, default) → {String}
Translates action name
Parameters:
Name | Type | Description |
---|---|---|
actionName |
String | |
default |
String |
- Source:
Returns:
- Type
- String
(static) trField(modelName, fieldName, default) → {String}
Translates field name
Parameters:
Name | Type | Description |
---|---|---|
modelName |
String | |
fieldName |
String | |
default |
String |
- Source:
Returns:
- Type
- String
(static) trModel(modelAdmin) → {Object}
Translates model name
Parameters:
Name | Type | Description |
---|---|---|
modelAdmin |
ModelAdmin |
- Source:
Returns:
{ label, plural, hint}
- Type
- Object