[aur-dev] [PATCH 3/4] Let co-maintainers edit package keywords

Johannes Löthberg johannes at kyriasis.com
Sat Jun 20 10:44:38 UTC 2015


Signed-off-by: Johannes Löthberg <johannes at kyriasis.com>
---
 web/lib/pkgbasefuncs.inc.php | 3 ++-
 web/template/pkg_details.php | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index d9185e7..92202bf 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -957,7 +957,8 @@ function pkgbase_get_keywords($base_id) {
 function pkgbase_set_keywords($base_id, $keywords) {
 	$base_id = intval($base_id);
 
-	if (!has_credential(CRED_PKGBASE_SET_KEYWORDS, array(pkgbase_maintainer_uid($base_id)))) {
+	$maintainers = array_merge(array(pkgbase_maintainer_uid($base_id)), pkgbase_get_comaintainer_uids(array($base_id)));
+	if (!has_credential(CRED_PKGBASE_SET_KEYWORDS, $maintainers)) {
 		return array(false, __("You are not allowed to edit the keywords of this package base."));
 	}
 
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index fb81442..9a360e3 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -196,13 +196,13 @@ $sources = pkg_sources($row["ID"]);
 			<td><a href="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?= htmlspecialchars($row['URL'], ENT_QUOTES) ?></a></td>
 		</tr>
 <?php
-if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"])) || count($keywords) > 0):
+if (has_credential(CRED_PKGBASE_SET_KEYWORDS, $maintainers) || count($keywords) > 0):
 ?>
 		<tr>
 			<th><?= __('Keywords') . ': ' ?></th>
 			<td>
 <?php
-if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"]))):
+if (has_credential(CRED_PKGBASE_SET_KEYWORDS, $maintainers)):
 ?>
 				<form method="post" action="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
 					<div>
-- 
2.4.4


More information about the aur-dev mailing list