sg481n | bd890c5 | 2017-08-28 12:11:35 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. |
| 3 | // |
| 4 | USE authz; |
| 5 | |
| 6 | // Create Root pass |
| 7 | INSERT INTO cred (id,ns,type,cred,expires) |
| 8 | VALUES ('dgl@openecomp.org','org.openecomp',1,0xab3831f27b39d7a039f9a92aa2bbfe51,'2020-12-31'); |
| 9 | |
| 10 | // Create 'com' root NS |
| 11 | INSERT INTO ns (name,scope,description,parent,type) |
| 12 | VALUES('com',1,'Root Namespace',null,1); |
| 13 | |
| 14 | INSERT INTO role(ns, name, perms, description) |
| 15 | VALUES('com','admin',{'com.access|*|*'},'Com Admins'); |
| 16 | |
| 17 | INSERT INTO role(ns, name, perms, description) |
| 18 | VALUES('com','owner',{'com.access|*|read'},'Com Owners'); |
| 19 | |
| 20 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 21 | VALUES ('com','access','*','read',{'com.owner'},'Com Read Access'); |
| 22 | |
| 23 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 24 | VALUES ('com','access','*','*',{'com.admin'},'Com Write Access'); |
| 25 | |
| 26 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 27 | VALUES ('dgl@openecomp.org','com.owner','2020-12-31','com','owner'); |
| 28 | |
| 29 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 30 | VALUES ('dgl@openecomp.org','com.admin','2020-12-31','com','admin'); |
| 31 | |
| 32 | // Create org root NS |
| 33 | INSERT INTO ns (name,scope,description,parent,type) |
| 34 | VALUES('org',1,'Root Namespace Org',null,1); |
| 35 | |
| 36 | INSERT INTO role(ns, name, perms, description) |
| 37 | VALUES('org','admin',{'org.access|*|*'},'Com Admins'); |
| 38 | |
| 39 | INSERT INTO role(ns, name, perms, description) |
| 40 | VALUES('org','owner',{'org.access|*|read'},'Com Owners'); |
| 41 | |
| 42 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 43 | VALUES ('org','access','*','read',{'org.owner'},'Com Read Access'); |
| 44 | |
| 45 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 46 | VALUES ('org','access','*','*',{'org.admin'},'Com Write Access'); |
| 47 | |
| 48 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 49 | VALUES ('dgl@openecomp.org','org.owner','2020-12-31','org','owner'); |
| 50 | |
| 51 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 52 | VALUES ('dgl@openecomp.org','org.admin','2020-12-31','org','admin'); |
| 53 | |
| 54 | |
| 55 | // Create com.att |
| 56 | |
| 57 | INSERT INTO ns (name,scope,description,parent,type) |
| 58 | VALUES('com.att',2,'AT&T Namespace','com',2); |
| 59 | |
| 60 | INSERT INTO role(ns, name, perms,description) |
| 61 | VALUES('com.att','admin',{'com.att.access|*|*'},'AT&T Admins'); |
| 62 | |
| 63 | INSERT INTO role(ns, name, perms,description) |
| 64 | VALUES('com.att','owner',{'com.att.access|*|read'},'AT&T Owners'); |
| 65 | |
| 66 | INSERT INTO perm(ns, type, instance, action, roles,description) |
| 67 | VALUES ('com.att','access','*','read',{'com.att.owner'},'AT&T Read Access'); |
| 68 | |
| 69 | INSERT INTO perm(ns, type, instance, action, roles,description) |
| 70 | VALUES ('com.att','access','*','*',{'com.att.admin'},'AT&T Write Access'); |
| 71 | |
| 72 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 73 | VALUES ('dgl@openecomp.org','com.att.owner','2020-12-31','com.att','owner'); |
| 74 | |
| 75 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 76 | VALUES ('dgl@openecomp.org','com.att.admin','2020-12-31','com.att','admin'); |
| 77 | |
| 78 | // Create com.att.aaf |
| 79 | |
| 80 | INSERT INTO ns (name,scope,description,parent,type) |
| 81 | VALUES('com.att.aaf',3,'Application Authorization Framework','com.att',3); |
| 82 | |
| 83 | INSERT INTO role(ns, name, perms, description) |
| 84 | VALUES('com.att.aaf','admin',{'com.att.aaf.access|*|*'},'AAF Admins'); |
| 85 | |
| 86 | INSERT INTO role(ns, name, perms, description) |
| 87 | VALUES('com.att.aaf','owner',{'com.att.aaf.access|*|read'},'AAF Owners'); |
| 88 | |
| 89 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 90 | VALUES ('com.att.aaf','access','*','read',{'com.att.aaf.owner'},'AAF Read Access'); |
| 91 | |
| 92 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 93 | VALUES ('com.att.aaf','access','*','*',{'com.att.aaf.admin'},'AAF Write Access'); |
| 94 | |
| 95 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 96 | VALUES ('dgl@openecomp.org','com.att.aaf.admin','2020-12-31','com.att.aaf','admin'); |
| 97 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 98 | VALUES ('dgl@openecomp.org','com.att.aaf.owner','2020-12-31','com.att.aaf','owner'); |
| 99 | |
| 100 | |
| 101 | // Create org.openecomp |
| 102 | INSERT INTO ns (name,scope,description,parent,type) |
| 103 | VALUES('org.openecomp',2,'Open EComp NS','com.att',2); |
| 104 | |
| 105 | INSERT INTO role(ns, name, perms, description) |
| 106 | VALUES('org.openecomp','admin',{'org.openecomp.access|*|*'},'OpenEcomp Admins'); |
| 107 | |
| 108 | INSERT INTO role(ns, name, perms, description) |
| 109 | VALUES('org.openecomp','owner',{'org.openecomp.access|*|read'},'OpenEcomp Owners'); |
| 110 | |
| 111 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 112 | VALUES ('org.openecomp','access','*','read',{'org.openecomp.owner'},'OpenEcomp Read Access'); |
| 113 | |
| 114 | INSERT INTO perm(ns, type, instance, action, roles, description) |
| 115 | VALUES ('org.openecomp','access','*','*',{'org.openecomp.admin'},'OpenEcomp Write Access'); |
| 116 | |
| 117 | INSERT INTO user_role(user,role,expires,ns,rname) |
| 118 | VALUES ('dgl@openecomp.org','org.openecomp.admin','2020-12-31','org.openecomp','admin'); |