Commit 0c28a478 authored by Leigh Stoller's avatar Leigh Stoller

Allow emulab-ops members to enter node log entries.

parent 1fe966df
......@@ -146,7 +146,7 @@ use vars qw(@ISA @EXPORT);
TBDB_PHYSICAL_NODE_TABLES
TBAdmin TBProjAccessCheck TBNodeAccessCheck TBOSIDAccessCheck
TBAdmin TBOpsGuy TBProjAccessCheck TBNodeAccessCheck TBOSIDAccessCheck
TBImageIDAccessCheck TBExptAccessCheck ExpLeader MarkNodeDown
SetNodeBootStatus OSFeatureSupported IsShelved NodeidToExp NodeidToExpOldReserved
UserDBInfo DBQuery DBQueryFatal DBQueryWarn DBWarn DBFatal
......@@ -861,6 +861,31 @@ sub TBAdmin(;$)
return 0;
}
#
# Test whether current user is a member of the emulab-ops project.
#
sub TBOpsGuy(;$)
{
my($uid) = @_;
my($name);
if (!defined($uid)) {
$uid = $UID;
}
#
# Test if numeric. Map to name if it is.
#
if ($uid =~ /^[0-9]+$/) {
($name) = getpwuid($uid)
or die "$uid not in passwd file\n";
}
else {
$name = $uid;
}
return TBMinTrust(TBProjTrust($name, $TBOPSPID), PROJMEMBERTRUST_USER());
}
#
# Project permission checks. The group id (gid) can be undef, in which case
# the pid is used (ie: a default group check is made).
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2002, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -36,7 +36,7 @@ if (!$UID) {
die("*** $0:\n".
" Please do not run this script as root!\n");
}
if (!TBAdmin($UID)) {
if (! (TBAdmin($UID) || TBOpsGuy($UID))) {
die("*** $0:\n".
" You must be a TB administrator to enter a log entry\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment