Browse Source

new column 'access' in table attr_types

Karel Kozlik 19 years ago
parent
commit
0350b13284

+ 14 - 1
db/schema/attr_types.xml

@@ -9,7 +9,7 @@
 
 <table xmlns:my="http://iptel.org/dbschema/mysql" role="serweb">
     <name>attr_types</name>
-    <version>2</version>
+    <version>3</version>
     <description>
 	Each attribute, identified by name, has associated set of
 	properties and constraints. This table contains types and
@@ -99,6 +99,18 @@
 	</description>
     </column>
 
+    <column role="serweb" id="at.access">
+        <name>access</name>
+	<type>int</type>
+        <default>0</default>
+        <description>
+	    Access rights to attribute. Meaning values is this:
+	        0 - full access (read and write)
+		1 - read only for users (read and write for admins)
+		3 - admins only (read and write), no access for users
+        </description>
+    </column>
+
 	<column role="serweb" id="at.order">
 	<name>ordering</name>
 	<type>int</type>
@@ -126,6 +138,7 @@
          <value col="at.d_flags">33</value>
          <value col="at.prior">256</value>
          <value col="at.order">200</value>
+	 <value col="at.access">1</value>
     </row>
 	 
     <row><value col="at.name">fr_timer</value>    

+ 33 - 33
scripts/dbtext/ser_db/attr_types

@@ -1,33 +1,33 @@
-name(str) rich_type(str) raw_type(int) type_spec(str,null) description(str,null) default_flags(int) flags(int) priority(int) ordering(int) 
-uid:string:2:::1:0:0:0
-did:string:2:::1:0:0:0
-asserted_id:string:2::asserted identity:33:0:256:200
-fr_timer:int:0::@ff_fr_timer:33:0:1073807616:140
-fr_inv_timer:int:0::@ff_fr_inv_timer:33:0:1073807616:150
-gflags:int:0::global flags:33:0:1073741824:0
-digest_realm:string:2::digest realm:33:4096:65536:0
-acl:string:2::access control list of user:33:1024:0:0
-first_name:string:2::@ff_first_name:32:2048:256:10
-last_name:string:2::@ff_last_name:32:2048:256:20
-email:email_adr:2::@ff_email:33:6144:256:30
-timezone:timezone:2::@ff_timezone:32:2048:1073807616:60
-sw_allow_find:boolean:0::@ff_allow_lookup_for_me:32:0:256:110
-lang:lang:2::@ff_language:33:0:1073807616:50
-sw_show_status:boolean:0::@ff_status_visibility:32:0:1073742080:100
-sw_admin:string:2::admin of domain:32:1024:0:0
-sw_owner:string:2::owner of domain:32:0:0:0
-sw_domain_default_flags:int:0::@ff_domain_def_f:32:4096:1073741824:0
-sw_deleted_ts:int:0::deleted timestamp:32:0:0:0
-phone:string:2::@ff_phone:32:2048:256:40
-sw_acl_control:string:2::acl control:32:1024:0:0
-sw_credential_default_flags:int:0::@ff_credential_def_f:32:4096:1073741824:0
-sw_uri_default_flags:int:0::@ff_uri_def_f:32:4096:1073741824:0
-sw_is_admin:boolean:0::admin privilege:32:0:0:0
-sw_is_hostmaster:boolean:0::hostmaster privilege:32:0:0:0
-sw_confirmation:string:2::registration confirmation:32:0:0:0
-sw_pending_ts:string:2::registration timestamp:32:0:0:0
-sw_require_confirm:boolean:0::@ff_reg_confirmation:32:0:1073807360:120
-sw_send_missed:boolean:0::@ff_send_daily_missed_calls:32:0:1073807616:130
-uid_format:list:2:a\:3\:{i\:0;s\:14\:"username@realm";i\:1;s\:21\:"integer (incremental)";i\:2;s\:15\:"UUID by RFC4122";}:@ff_uid_format:32:0:1073741824:160
-did_format:list:2:a\:3\:{i\:0;s\:11\:"domain name";i\:1;s\:21\:"integer (incremental)";i\:2;s\:15\:"UUID by RFC4122";}:@ff_did_format:32:0:1073741824:170
-contact_email:email_adr:2::@ff_contact_email:32:4096:1073807360:0
+name(str) rich_type(str) raw_type(int) type_spec(str,null) description(str,null) default_flags(int) flags(int) priority(int) access(int) ordering(int) 
+uid:string:2:::1:0:0:0:0
+did:string:2:::1:0:0:0:0
+asserted_id:string:2::asserted identity:33:0:256:1:200
+fr_timer:int:0::@ff_fr_timer:33:0:1073807616:0:140
+fr_inv_timer:int:0::@ff_fr_inv_timer:33:0:1073807616:0:150
+gflags:int:0::global flags:33:0:1073741824:0:0
+digest_realm:string:2::digest realm:33:4096:65536:0:0
+acl:string:2::access control list of user:33:1024:0:0:0
+first_name:string:2::@ff_first_name:32:2048:256:0:10
+last_name:string:2::@ff_last_name:32:2048:256:0:20
+email:email_adr:2::@ff_email:33:6144:256:0:30
+timezone:timezone:2::@ff_timezone:32:2048:1073807616:0:60
+sw_allow_find:boolean:0::@ff_allow_lookup_for_me:32:0:256:0:110
+lang:lang:2::@ff_language:33:0:1073807616:0:50
+sw_show_status:boolean:0::@ff_status_visibility:32:0:1073742080:0:100
+sw_admin:string:2::admin of domain:32:1024:0:0:0
+sw_owner:string:2::owner of domain:32:0:0:0:0
+sw_domain_default_flags:int:0::@ff_domain_def_f:32:4096:1073741824:0:0
+sw_deleted_ts:int:0::deleted timestamp:32:0:0:0:0
+phone:string:2::@ff_phone:32:2048:256:0:40
+sw_acl_control:string:2::acl control:32:1024:0:0:0
+sw_credential_default_flags:int:0::@ff_credential_def_f:32:4096:1073741824:0:0
+sw_uri_default_flags:int:0::@ff_uri_def_f:32:4096:1073741824:0:0
+sw_is_admin:boolean:0::admin privilege:32:0:0:0:0
+sw_is_hostmaster:boolean:0::hostmaster privilege:32:0:0:0:0
+sw_confirmation:string:2::registration confirmation:32:0:0:0:0
+sw_pending_ts:string:2::registration timestamp:32:0:0:0:0
+sw_require_confirm:boolean:0::@ff_reg_confirmation:32:0:1073807360:0:120
+sw_send_missed:boolean:0::@ff_send_daily_missed_calls:32:0:1073807616:0:130
+uid_format:list:2:a\:3\:{i\:0;s\:14\:"username@realm";i\:1;s\:21\:"integer (incremental)";i\:2;s\:15\:"UUID by RFC4122";}:@ff_uid_format:32:0:1073741824:0:160
+did_format:list:2:a\:3\:{i\:0;s\:11\:"domain name";i\:1;s\:21\:"integer (incremental)";i\:2;s\:15\:"UUID by RFC4122";}:@ff_did_format:32:0:1073741824:0:170
+contact_email:email_adr:2::@ff_contact_email:32:4096:1073807360:0:0

+ 3 - 2
scripts/mysql/my_create.sql

@@ -78,7 +78,7 @@ CREATE TABLE credentials (
     KEY uid (uid)
 );
 
-INSERT INTO version (table_name, table_version) values ('attr_types','2');
+INSERT INTO version (table_name, table_version) values ('attr_types','3');
 CREATE TABLE attr_types (
     name VARCHAR(32) NOT NULL,
     rich_type VARCHAR(32) NOT NULL DEFAULT 'string',
@@ -88,13 +88,14 @@ CREATE TABLE attr_types (
     default_flags INT NOT NULL DEFAULT '0',
     flags INT NOT NULL DEFAULT '0',
     priority INT NOT NULL DEFAULT '0',
+    access INT NOT NULL DEFAULT '0',
     ordering INT NOT NULL DEFAULT '0',
     UNIQUE KEY upt_idx1 (name)
 );
 
 INSERT INTO attr_types (name, raw_type, default_flags) VALUES ('uid', '2', '1');
 INSERT INTO attr_types (name, raw_type, default_flags) VALUES ('did', '2', '1');
-INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('asserted_id', '2', 'string', 'asserted identity', '33', '256', '200');
+INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering, access) VALUES ('asserted_id', '2', 'string', 'asserted identity', '33', '256', '200', '1');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('fr_timer', '0', 'int', '@ff_fr_timer', '33', '1073807616', '140');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('fr_inv_timer', '0', 'int', '@ff_fr_inv_timer', '33', '1073807616', '150');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('gflags', '0', 'int', 'global flags', '33', '1073741824', '0');

+ 3 - 2
scripts/oracle/or_create.sql

@@ -76,7 +76,7 @@ CREATE TABLE credentials (
     uid string(64) NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('attr_types','2');
+INSERT INTO version (table_name, table_version) values ('attr_types','3');
 CREATE TABLE attr_types (
     name string(32) NOT NULL,
     rich_type string(32) NOT NULL DEFAULT 'string',
@@ -86,13 +86,14 @@ CREATE TABLE attr_types (
     default_flags int NOT NULL DEFAULT '0',
     flags int NOT NULL DEFAULT '0',
     priority int NOT NULL DEFAULT '0',
+    access int NOT NULL DEFAULT '0',
     ordering int NOT NULL DEFAULT '0',
     upt_idx1 UNIQUE (name, )
 );
 
 INSERT INTO attr_types (name, raw_type, default_flags) VALUES ('uid', '2', '1');
 INSERT INTO attr_types (name, raw_type, default_flags) VALUES ('did', '2', '1');
-INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('asserted_id', '2', 'string', 'asserted identity', '33', '256', '200');
+INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering, access) VALUES ('asserted_id', '2', 'string', 'asserted identity', '33', '256', '200', '1');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('fr_timer', '0', 'int', '@ff_fr_timer', '33', '1073807616', '140');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('fr_inv_timer', '0', 'int', '@ff_fr_inv_timer', '33', '1073807616', '150');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('gflags', '0', 'int', 'global flags', '33', '1073741824', '0');

+ 2 - 1
scripts/postgres/pg_create.sql

@@ -88,13 +88,14 @@ CREATE TABLE attr_types (
     default_flags INTEGER NOT NULL DEFAULT '0',
     flags INTEGER NOT NULL DEFAULT '0',
     priority INTEGER NOT NULL DEFAULT '0',
+    access INTEGER NOT NULL DEFAULT '0',
     ordering INTEGER NOT NULL DEFAULT '0',
     CONSTRAINT upt_idx1 UNIQUE (name)
 );
 
 INSERT INTO attr_types (name, raw_type, default_flags) VALUES ('uid', '2', '1');
 INSERT INTO attr_types (name, raw_type, default_flags) VALUES ('did', '2', '1');
-INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('asserted_id', '2', 'string', 'asserted identity', '33', '256', '200');
+INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering, access) VALUES ('asserted_id', '2', 'string', 'asserted identity', '33', '256', '200', '1');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('fr_timer', '0', 'int', '@ff_fr_timer', '33', '1073807616', '140');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('fr_inv_timer', '0', 'int', '@ff_fr_inv_timer', '33', '1073807616', '150');
 INSERT INTO attr_types (name, raw_type, rich_type, description, default_flags, priority, ordering) VALUES ('gflags', '0', 'int', 'global flags', '33', '1073741824', '0');