You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2016/12/16 21:16:45 UTC
[48/50] incubator-trafficcontrol git commit: ensures only ops or
admin role can snapshot crconfig
ensures only ops or admin role can snapshot crconfig
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/3a75935e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/3a75935e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/3a75935e
Branch: refs/heads/postgres
Commit: 3a75935eb1f3e39857fcb5d6c164ec5fb1a109a0
Parents: 77c8bb6
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Fri Dec 9 12:37:08 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Dec 16 14:10:49 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/UI/Tools.pm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3a75935e/traffic_ops/app/lib/UI/Tools.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/Tools.pm b/traffic_ops/app/lib/UI/Tools.pm
index 218f197..8b385fb 100644
--- a/traffic_ops/app/lib/UI/Tools.pm
+++ b/traffic_ops/app/lib/UI/Tools.pm
@@ -113,9 +113,13 @@ sub write_crconfig {
$self->flash( alertmsg => $error );
}
else {
- UI::Topology::write_crconfig_json_to_db( $self, $cdn_name, $json );
- &log( $self, "Snapshot CRConfig created.", "OPER" );
- $self->flash( alertmsg => "Successfully wrote CRConfig.json!" );
+ if ( !&is_oper($self) ) {
+ $self->flash( alertmsg => "No can do. Get more privs." );
+ } else {
+ UI::Topology::write_crconfig_json_to_db( $self, $cdn_name, $json );
+ &log( $self, "Snapshot CRConfig created.", "OPER" );
+ $self->flash( alertmsg => "Successfully wrote CRConfig.json!" );
+ }
}
return $self->redirect_to('/utils/close_fancybox');
}