mirror of
https://github.com/strapi/strapi.git
synced 2025-11-09 06:40:42 +00:00
Update wording
This commit is contained in:
parent
43e360a641
commit
31ef51e245
@ -51,7 +51,7 @@ module.exports = params => {
|
|||||||
/**
|
/**
|
||||||
* Ignore the permission if the fields property is an empty array (access to no field)
|
* Ignore the permission if the fields property is an empty array (access to no field)
|
||||||
*/
|
*/
|
||||||
.on('post-format::validate.permission', ({ permission }) => {
|
.on('after-format::validate.permission', ({ permission }) => {
|
||||||
const { fields } = permission.properties;
|
const { fields } = permission.properties;
|
||||||
|
|
||||||
if (isArray(fields) && isEmpty(fields)) {
|
if (isArray(fields) && isEmpty(fields)) {
|
||||||
|
|||||||
@ -59,7 +59,7 @@ const ability = await engine.generateAbility([
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
ability.can('read'); // false since we didn't register the read permission because of the validation hook
|
ability.can('read'); // false since the validation hook prevents the engine from registering the permission
|
||||||
ability.can('publish'); // false
|
ability.can('publish'); // false
|
||||||
ability.can('update', 'foo'); // false
|
ability.can('update', 'foo'); // false
|
||||||
ability.can('update', 'bar'); // true
|
ability.can('update', 'bar'); // true
|
||||||
|
|||||||
@ -11,7 +11,7 @@ const domain = require('../domain');
|
|||||||
const createEngineHooks = () => ({
|
const createEngineHooks = () => ({
|
||||||
'before-format::validate.permission': hooks.createAsyncBailHook(),
|
'before-format::validate.permission': hooks.createAsyncBailHook(),
|
||||||
'format.permission': hooks.createAsyncSeriesWaterfallHook(),
|
'format.permission': hooks.createAsyncSeriesWaterfallHook(),
|
||||||
'post-format::validate.permission': hooks.createAsyncBailHook(),
|
'after-format::validate.permission': hooks.createAsyncBailHook(),
|
||||||
'before-evaluate.permission': hooks.createAsyncSeriesHook(),
|
'before-evaluate.permission': hooks.createAsyncSeriesHook(),
|
||||||
'before-register.permission': hooks.createAsyncSeriesHook(),
|
'before-register.permission': hooks.createAsyncSeriesHook(),
|
||||||
});
|
});
|
||||||
|
|||||||
@ -68,12 +68,12 @@ module.exports = {
|
|||||||
|
|
||||||
const permission = await state.hooks['format.permission'].call(params.permission);
|
const permission = await state.hooks['format.permission'].call(params.permission);
|
||||||
|
|
||||||
const postFormatValidation = await runValidationHook(
|
const afterFormatValidation = await runValidationHook(
|
||||||
'post-format::validate.permission',
|
'after-format::validate.permission',
|
||||||
createValidateContext(permission)
|
createValidateContext(permission)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (postFormatValidation === false) {
|
if (afterFormatValidation === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user