codeq/advancedpublish
Composer 安装命令:
composer require codeq/advancedpublish
包简介
The package adds a review workflow and change logs to the Neos publication function
README 文档
README
This package enforces a four-eyes-principle for publishing changes. For that reasons, every user gets an additional workspace, on which changes staged for publication are parked. The user then can request a review from an authorized user, who can then publish the changes to the live workspace. The reviewer can also reject the changes, whereupon the editor can revise the changes and request a new review.
Roles
CodeQ.AdvancedPublish:AbstractReviewer
This role can be used to give users the ability to review changes.
Using this role aims at not being fully able to publish changes,
but to be restricted later using custom filters in the CodeQ.AdvancedPublish.reviewers.filterImplementations setting.
CodeQ.AdvancedPublish:CanReview
This role can be used to give users the ability to review changes with the aim to be able to publish changes across the site without any restriction.
CodeQ.AdvancedPublish:CanReviewOwnRequests
This role can be used to give users the ability to review their own requests.
CodeQ.AdvancedPublish:CanViewProtocol
This role can be used to give users the ability to view the publication protocol.
CodeQ.AdvancedPublish:SuperEditor
This role is allowed to see the original workspace dropdown in the Neos UI and to switch workspaces. Other users only see a simplified publish button without the option to switch workspaces.
Reviewer Filters
The package provides a flexible system to control which reviewers are allowed to publish specific content. This is implemented through reviewer filters that check if a user has the necessary permissions to publish a node.
How Reviewer Filters Work
- Each filter implements the
ReviewerFilterInterfaceand returns a boolean value. - If at least one filter returns
true, the reviewer is allowed to publish the content. - If all filters return
false, the reviewer is not allowed to publish the content.
Implementing Custom Reviewer Filters
To create a custom reviewer filter:
- Create a class that implements
CodeQ\AdvancedPublish\Domain\Service\ReviewerFilterInterface - Implement the
checkFilterConditionsForUserAndNodemethod that returnstrueif the user is allowed to publish the node, orfalseotherwise - Register your filter in the Settings.yaml configuration:
CodeQ: AdvancedPublish: reviewers: filterImplementations: YourFilter: 'Your\Namespace\YourFilterClass'
Example Filter Implementation
<?php namespace Your\Namespace; use CodeQ\AdvancedPublish\Domain\Service\ReviewerFilterInterface; use CodeQ\AdvancedPublish\Domain\Service\UserService; use CodeQ\AdvancedPublish\Utility\RolesUtility; use Neos\ContentRepository\Domain\Model\NodeInterface; use Neos\Neos\Domain\Model\User; class YourFilterClass implements ReviewerFilterInterface { public function checkFilterConditionsForUserAndNode(User $user, NodeInterface $node): bool { $neosBackendAccount = UserService::findNeosBackendAccount($user); // Your custom logic to determine if the user can publish the node // Return true if allowed, false otherwise return $someCondition && RolesUtility::containsRole($neosBackendAccount->getRoles(), 'Your.Package:YourRole'); } }
Suggested project changes
Deny live publishing and manipulation of workspaces
'Neos.Flow:Everybody': privileges: - privilegeTarget: 'Neos.Neos:Backend.PublishToLiveWorkspace' permission: DENY - privilegeTarget: 'Neos.Neos:Backend.PublishAllToLiveWorkspace' permission: DENY - privilegeTarget: 'Neos.Neos:Backend.CreateWorkspaces' permission: DENY - privilegeTarget: 'Neos.Neos:Backend.Module.Management.Workspaces.ManageOwnWorkspaces' permission: DENY - privilegeTarget: 'Neos.Neos:Backend.Module.Management.Workspaces.ManageInternalWorkspaces' permission: DENY - privilegeTarget: 'Neos.Neos:Backend.Module.Management.Workspaces.ManageAllPrivateWorkspaces' permission: DENY
codeq/advancedpublish 适用场景与选型建议
codeq/advancedpublish 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.44k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 07 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 codeq/advancedpublish 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codeq/advancedpublish 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-07-11