Skip to content

Commit

Permalink
tweak(Tinebase): allow import without AutoTags if no right to create …
Browse files Browse the repository at this point in the history
…shared Tags
  • Loading branch information
sstamer committed Dec 16, 2024
1 parent 26d9d93 commit 52e3112
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tine20/Tinebase/Import/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,12 @@ protected function _getSingleTag($_name, $_tagData = array(), $_create = TRUE)
'name' => $name,
);
/** @var Tinebase_Model_Tag $tag */
$tag = Tinebase_Tags::getInstance()->createSharedTags([$tagData])->getFirstRecord();
try {
$tag = Tinebase_Tags::getInstance()->createSharedTags([$tagData])->getFirstRecord();
} catch (Tinebase_Exception_AccessDenied $e) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. ' User has no grants to create Tags: ' . $e);
}
}

return $tag;
Expand Down
2 changes: 1 addition & 1 deletion tine20/Tinebase/js/widgets/dialog/ImportDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
show: function() {
var options = this.getImportPluginOptions();

if (options.autotags) {
if (options.autotags && Tine.Tinebase.common.hasRight('manage_shared_tags', 'Admin')) {
var tags = options.autotags;

Ext.each([].concat(tags), function(tag) {
Expand Down

0 comments on commit 52e3112

Please sign in to comment.