diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2015-03-04 12:15:05 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2015-03-04 12:16:33 +0100 |
commit | 5dca715c46669a2e1ed193c13aacff03e7e237ff (patch) | |
tree | f811defc5fa84f4532a0197633eca08ec2b5e655 /web/lib/pkgbasefuncs.inc.php | |
parent | 84061604aade7224b4f9e3e998c18395e5d1d351 (diff) |
Allow users to delete their own packages
Allow users to remove their own package bases for a short period of time
after initial submission (defaults to one day).
Implements FS#43648.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgbasefuncs.inc.php')
-rw-r--r-- | web/lib/pkgbasefuncs.inc.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index 5741b01..6f9ef85 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -436,11 +436,12 @@ function pkgbase_unflag($base_ids) { * @param array $base_ids Array of package base IDs to delete * @param int $merge_base_id Package base to merge the deleted ones into * @param int $via Package request to close upon deletion + * @param bool $grant Allow anyone to delete the package base * * @return array Tuple of success/failure indicator and error message */ -function pkgbase_delete ($base_ids, $merge_base_id, $via) { - if (!has_credential(CRED_PKGBASE_DELETE)) { +function pkgbase_delete ($base_ids, $merge_base_id, $via, $grant=false) { + if (!$grant && !has_credential(CRED_PKGBASE_DELETE)) { return array(false, __("You do not have permission to delete packages.")); } |