summaryrefslogtreecommitdiffstats
path: root/authz-cass/src/main/cql/ecomp.cql
blob: 967d6daf244e3deb830b7d4d50f3bbf160433694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//
//  Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
// 
USE authz;

// Create Root pass
INSERT INTO cred (id,ns,type,cred,expires)
  VALUES ('dgl@openecomp.org','org.openecomp',1,0xab3831f27b39d7a039f9a92aa2bbfe51,'2020-12-31');

// Create 'com' root NS
INSERT INTO ns (name,scope,description,parent,type)
  VALUES('com',1,'Root Namespace',null,1);

INSERT INTO role(ns, name, perms, description)
  VALUES('com','admin',{'com.access|*|*'},'Com Admins');

INSERT INTO role(ns, name, perms, description)
  VALUES('com','owner',{'com.access|*|read'},'Com Owners');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('com','access','*','read',{'com.owner'},'Com Read Access');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('com','access','*','*',{'com.admin'},'Com Write Access');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','com.owner','2020-12-31','com','owner');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','com.admin','2020-12-31','com','admin');

// Create org root NS
INSERT INTO ns (name,scope,description,parent,type)
  VALUES('org',1,'Root Namespace Org',null,1);

INSERT INTO role(ns, name, perms, description)
  VALUES('org','admin',{'org.access|*|*'},'Com Admins');

INSERT INTO role(ns, name, perms, description)
  VALUES('org','owner',{'org.access|*|read'},'Com Owners');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('org','access','*','read',{'org.owner'},'Com Read Access');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('org','access','*','*',{'org.admin'},'Com Write Access');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','org.owner','2020-12-31','org','owner');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','org.admin','2020-12-31','org','admin');


// Create com.att

INSERT INTO ns (name,scope,description,parent,type)
  VALUES('com.att',2,'AT&T Namespace','com',2);

INSERT INTO role(ns, name, perms,description)
  VALUES('com.att','admin',{'com.att.access|*|*'},'AT&T Admins');

INSERT INTO role(ns, name, perms,description)
  VALUES('com.att','owner',{'com.att.access|*|read'},'AT&T Owners');

INSERT INTO perm(ns, type, instance, action, roles,description) 
  VALUES ('com.att','access','*','read',{'com.att.owner'},'AT&T Read Access');

INSERT INTO perm(ns, type, instance, action, roles,description) 
  VALUES ('com.att','access','*','*',{'com.att.admin'},'AT&T Write Access');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','com.att.owner','2020-12-31','com.att','owner');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','com.att.admin','2020-12-31','com.att','admin');

// Create com.att.aaf

INSERT INTO ns (name,scope,description,parent,type)
  VALUES('com.att.aaf',3,'Application Authorization Framework','com.att',3);

INSERT INTO role(ns, name, perms, description)
  VALUES('com.att.aaf','admin',{'com.att.aaf.access|*|*'},'AAF Admins');

INSERT INTO role(ns, name, perms, description)
  VALUES('com.att.aaf','owner',{'com.att.aaf.access|*|read'},'AAF Owners');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('com.att.aaf','access','*','read',{'com.att.aaf.owner'},'AAF Read Access');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('com.att.aaf','access','*','*',{'com.att.aaf.admin'},'AAF Write Access');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','com.att.aaf.admin','2020-12-31','com.att.aaf','admin');
INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','com.att.aaf.owner','2020-12-31','com.att.aaf','owner');
  

// Create org.openecomp
INSERT INTO ns (name,scope,description,parent,type)
  VALUES('org.openecomp',2,'Open EComp NS','com.att',2);

INSERT INTO role(ns, name, perms, description)
  VALUES('org.openecomp','admin',{'org.openecomp.access|*|*'},'OpenEcomp Admins');

INSERT INTO role(ns, name, perms, description)
  VALUES('org.openecomp','owner',{'org.openecomp.access|*|read'},'OpenEcomp Owners');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('org.openecomp','access','*','read',{'org.openecomp.owner'},'OpenEcomp Read Access');

INSERT INTO perm(ns, type, instance, action, roles, description) 
  VALUES ('org.openecomp','access','*','*',{'org.openecomp.admin'},'OpenEcomp Write Access');

INSERT INTO user_role(user,role,expires,ns,rname)
  VALUES ('dgl@openecomp.org','org.openecomp.admin','2020-12-31','org.openecomp','admin');