zrhoffman commented on code in PR #6802:
URL: https://github.com/apache/trafficcontrol/pull/6802#discussion_r876367242
##########
traffic_ops/app/db/create_tables.sql:
##########
@@ -462,6 +534,54 @@ ALTER TABLE cdn_id_seq OWNER TO traffic_ops;
ALTER SEQUENCE cdn_id_seq OWNED BY cdn.id;
+--
+-- Name: cdn_lock; Type: TABLE; Schema: public; Owner: traffic_ops
+--
+
+CREATE TABLE IF NOT EXISTS public.cdn_lock (
+ username text NOT NULL,
+ cdn text NOT NULL,
+ message text,
+ soft boolean NOT NULL DEFAULT TRUE,
+ last_updated timestamp with time zone DEFAULT now() NOT NULL,
+ CONSTRAINT pk_cdn_lock PRIMARY KEY ("cdn")
+);
+
+
+ALTER TABLE cdn_lock OWNER TO traffic_ops;
+
+--
+-- Name: cdn_notification; Type: TABLE; Schema: public; Owner: traffic_ops
+
+CREATE TABLE cdn_notification (
+ id bigint NOT NULL,
+ cdn text NOT NULL,
+ "user" text NOT NULL,
+ notification text,
Review Comment:
`notification` used to be `NOT NULL`
```diff
@@ -623,7 +623,7 @@
id bigint NOT NULL,
cdn text NOT NULL,
"user" text NOT NULL,
- notification text NOT NULL,
+ notification text,
last_updated timestamp with time zone DEFAULT now() NOT NULL
);
```
##########
traffic_ops/app/db/migrations/2021110210085600_add_permissions.up.sql:
##########
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
under
- * the License.
- */
-
--- add built-in roles
-INSERT INTO public.role (name, description, priv_level) VALUES ('operations',
'Has all reads and most write capabilities', 20) ON CONFLICT (name) DO NOTHING;
-INSERT INTO public.role (name, description, priv_level) VALUES ('read-only',
'Has access to all read capabilities', 10) ON CONFLICT (name) DO NOTHING;
-INSERT INTO public.role (name, description, priv_level) values ('disallowed',
'Block all access', 0) ON CONFLICT (name) DO NOTHING;
-INSERT INTO public.role (name, description, priv_level) VALUES
('portal','Portal User', 2) ON CONFLICT DO NOTHING;
-INSERT INTO public.role (name, description, priv_level) VALUES
('steering','Steering User', 15) ON CONFLICT DO NOTHING;
-INSERT INTO public.role (name, description, priv_level) VALUES
('federation','Role for Secondary CZF', 15) ON CONFLICT DO NOTHING;
Review Comment:
Some of these roles are missing now. `admin` being the first row now should
be okay
```diff
@@ -3009,13 +3009,10 @@
--
COPY public.role (id, name, description, priv_level, last_updated) FROM
stdin;
+1 admin Has access to everything - cannot be modified or deleted
30 A_TIMESTAMP
2 operations Has all reads and most write capabilities 20
A_TIMESTAMP
3 read-only Has access to all read capabilities 10
A_TIMESTAMP
4 disallowed Block all access 0 A_TIMESTAMP
-5 portal Portal User 2 A_TIMESTAMP
-6 steering Steering User 15 A_TIMESTAMP
-7 federation Role for Secondary CZF 15 A_TIMESTAMP
-1 admin Has access to everything - cannot be modified or deleted
30 A_TIMESTAMP
\.
```
##########
traffic_ops/app/db/create_tables.sql:
##########
@@ -143,6 +143,42 @@ LANGUAGE plpgsql;
Review Comment:
* `admin` user is missing some roles:
```diff
@@ -1,7 +1,4 @@
1 ALL A_TIMESTAMP
-1 DNS-SEC:DELETE A_TIMESTAMP
-1 DNS-SEC:READ A_TIMESTAMP
-1 PARAMETER-SECURE:READ A_TIMESTAMP
2 ASN:READ A_TIMESTAMP
2 ASYNC-STATUS:READ A_TIMESTAMP
2 CACHE-GROUP:READ A_TIMESTAMP
```
* `read-only` is missing a role:
```diff
@@ -63,7 +60,6 @@
3 CDN-SNAPSHOT:READ A_TIMESTAMP
3 COORDINATE:READ A_TIMESTAMP
3 DELIVERY-SERVICE:READ A_TIMESTAMP
-3 DELIVERY-SERVICE-SAFE:UPDATE A_TIMESTAMP
3 DIVISION:READ A_TIMESTAMP
3 DS-REQUEST:READ A_TIMESTAMP
3 DS-SECURITY-KEY:READ A_TIMESTAMP
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]