Merge pull request #10288 from owncloud/sharing_dont_show_share_dialog
don't show share dialog and navigation entry if sharing was disabled for the user
This commit is contained in:
commit
6dd7d9e0af
|
@ -33,7 +33,10 @@ OC_FileProxy::register(new OCA\Files\Share\Proxy());
|
||||||
"name" => $l->t('Shared with you')
|
"name" => $l->t('Shared with you')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
\OCA\Files\App::getNavigationManager()->add(
|
|
||||||
|
if (\OCP\Util::isSharingDisabledForUser() === false) {
|
||||||
|
|
||||||
|
\OCA\Files\App::getNavigationManager()->add(
|
||||||
array(
|
array(
|
||||||
"id" => 'sharingout',
|
"id" => 'sharingout',
|
||||||
"appname" => 'files_sharing',
|
"appname" => 'files_sharing',
|
||||||
|
@ -41,8 +44,8 @@ OC_FileProxy::register(new OCA\Files\Share\Proxy());
|
||||||
"order" => 15,
|
"order" => 15,
|
||||||
"name" => $l->t('Shared with others')
|
"name" => $l->t('Shared with others')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
\OCA\Files\App::getNavigationManager()->add(
|
\OCA\Files\App::getNavigationManager()->add(
|
||||||
array(
|
array(
|
||||||
"id" => 'sharinglinks',
|
"id" => 'sharinglinks',
|
||||||
"appname" => 'files_sharing',
|
"appname" => 'files_sharing',
|
||||||
|
@ -50,4 +53,5 @@ OC_FileProxy::register(new OCA\Files\Share\Proxy());
|
||||||
"order" => 20,
|
"order" => 20,
|
||||||
"name" => $l->t('Shared by link')
|
"name" => $l->t('Shared by link')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -960,6 +960,10 @@ class View {
|
||||||
$content['permissions'] = $storage->getPermissions($content['path']);
|
$content['permissions'] = $storage->getPermissions($content['path']);
|
||||||
$cache->update($content['fileid'], array('permissions' => $content['permissions']));
|
$cache->update($content['fileid'], array('permissions' => $content['permissions']));
|
||||||
}
|
}
|
||||||
|
// if sharing was disabled for the user we remove the share permissions
|
||||||
|
if (\OCP\Util::isSharingDisabledForUser()) {
|
||||||
|
$content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
|
||||||
|
}
|
||||||
$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
|
$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1008,6 +1012,12 @@ class View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rootEntry['path'] = substr($path . '/' . $rootEntry['name'], strlen($user) + 2); // full path without /$user/
|
$rootEntry['path'] = substr($path . '/' . $rootEntry['name'], strlen($user) + 2); // full path without /$user/
|
||||||
|
|
||||||
|
// if sharing was disabled for the user we remove the share permissions
|
||||||
|
if (\OCP\Util::isSharingDisabledForUser()) {
|
||||||
|
$content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
|
||||||
|
}
|
||||||
|
|
||||||
$files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry);
|
$files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue