Documentation - Schweriner/content_owners GitHub Wiki
What does it do?
This TYPO3 extension makes it possible to assign an owner to individual content elements, who is then the only non-admin who can still edit the element. This extension was developed because TYPO3 functions regarding user groups have so far only allowed the exclusion of entire tables or page areas, but not the exclusion per element.
The extension can also be used with any other TYPO3 TCA records.
Configuration
By default, the extension automatically implements the new functionality for tt_content. The new database field "tx_contentowner_owner" is defined as "exclude" in the TCA. So that non-admins can also see and set the field, you must also allow this field in the user-group access rights.
The extension currently provides three options in the extension configuration (in the backend via Extension Settings):
- autoEnableForTtcontent: With this you can disable that the extension will automatically add the restrictions to tt_content. Default: ON
- selfAssignRestriction: This option toggles if a user can only assign content elements to himself or even other non-admins. Default: Users can select any user as owner
- autoAssignToNonAdmins: This option toggles if users will be automatically assigned as owner when creating a new record. Default: Off
- hideUnassignedRows: (Since 1.1.0) This option toggles if users are able to see records in the recordlist which are not assigned to themself. Default: Off
Use for any other record
The extension is developed to be compatible with every other TCA record. The extension is watching for the DB field "tx_contentowner_owner" in any table. To use content_owners with another table, you just have to add the DB field and TCA.
Example:
Add the field to your records using your ext_tables.sql
CREATE TABLE tx_yourext_domain_model_record (
tx_contentowner_owner int(11) DEFAULT '0' NOT NULL
);
Add the field to your records TCA by using the provided TCA function of content_owners within your Configuration/TCA/tx_yourext_domain_model_record.php
or in any other Configuration/TCA/Overrides/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_yourext_domain_model_record',
\JanSass\ContentOwners\Utility\TcaUtility::getRestrictionTcaField()
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tx_yourext_domain_model_record', 'tx_contentowner_owner', '', 'after:endtime');