zrhoffman commented on code in PR #6802: URL: https://github.com/apache/trafficcontrol/pull/6802#discussion_r874087535
########## 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; - --- add permissions to roles in order of decreasing priv level -INSERT INTO public.role_capability SELECT id, perm FROM public.role CROSS JOIN (VALUES -('ASN:CREATE'), -('ASN:DELETE'), -('ASN:UPDATE'), -('CACHE-GROUP:CREATE'), Review Comment: Seeding roles in `seeds.sql` fails, so that part need needs to be updated, too https://github.com/apache/trafficcontrol/blob/8e75d3ee76c5fe637221ff47efe8ab12402f5870/traffic_ops/app/db/seeds.sql#L162-L170 -- 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]
