Rework permission handling

Add a new function has_credential() that checks whether the currently
logged in user is allowed to perform a given action. Moving all
permission handling to this central place makes adding new user groups
and adjusting permissions much more convenient.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Disallow privileged users to use invalid user names

Prevent Trusted Users and developers from accidentally using a name that
contains invalid characters. Also, remove user_is_privileged() which is
no longer needed after this change.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Add a new user group "Trusted User & Developer"

This group has full permissions on everything.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
home: requests should be filed in the web interface

There is a "file request" link in the "Package Actions" box
for every package.

Signed-off-by: Johannes Dewender <arch@JonnyJD.net>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Remove unused function pkg_details_by_name()

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Bcc notification emails to the request creator

Add both the request creator and the current package maintainer to the
Bcc list of notification emails for package requests.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Use Cc instead of Bcc in request notifications

Add the request creator and the current package maintainer to Cc instead
of Bcc when sending notification emails for package requests. This
allows users to forward any discussion to both of them by using the
"Group Reply" function of their MUA.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Mention the target of merge requests in emails

When sending the initial notification email for a merge request, include
the name of the package base that is the target of the requested merge
operation.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Fix pkgbase_votes_from_name()

In 676595f (Prefix package functions with pkg_/pkgbase_, 2014-04-05),
votes_for_pkgname() was renamed to pkgbase_votes_from_name() without
changing the semantics. Slightly adapt the implementation and interpret
the argument as a package base name instead of a package name. Also fix
the call site.

Reported-by: Felix Yan <felixonmars@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>