mirror of
https://github.com/strapi/strapi.git
synced 2025-10-31 18:08:11 +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)
|
||||
*/
|
||||
.on('post-format::validate.permission', ({ permission }) => {
|
||||
.on('after-format::validate.permission', ({ permission }) => {
|
||||
const { fields } = permission.properties;
|
||||
|
||||
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('update', 'foo'); // false
|
||||
ability.can('update', 'bar'); // true
|
||||
|
||||
@ -11,7 +11,7 @@ const domain = require('../domain');
|
||||
const createEngineHooks = () => ({
|
||||
'before-format::validate.permission': hooks.createAsyncBailHook(),
|
||||
'format.permission': hooks.createAsyncSeriesWaterfallHook(),
|
||||
'post-format::validate.permission': hooks.createAsyncBailHook(),
|
||||
'after-format::validate.permission': hooks.createAsyncBailHook(),
|
||||
'before-evaluate.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 postFormatValidation = await runValidationHook(
|
||||
'post-format::validate.permission',
|
||||
const afterFormatValidation = await runValidationHook(
|
||||
'after-format::validate.permission',
|
||||
createValidateContext(permission)
|
||||
);
|
||||
|
||||
if (postFormatValidation === false) {
|
||||
if (afterFormatValidation === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user