summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-24 14:41:07 +0100
committerlsces <lester@lsces.co.uk>2025-08-24 14:41:07 +0100
commita6cc0f5e5cf42c9a3a5b35a9d02cc25977a5896a (patch)
treefa8809e0f3f42a36caa57d31267443e42ce81b6e /admin
parent4b845764a11aa03a57a08e82db78f765f0606782 (diff)
downloadprotector-a6cc0f5e5cf42c9a3a5b35a9d02cc25977a5896a.tar.gz
protector-a6cc0f5e5cf42c9a3a5b35a9d02cc25977a5896a.tar.bz2
protector-a6cc0f5e5cf42c9a3a5b35a9d02cc25977a5896a.zip
Initial population in github
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/schema_inc.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
new file mode 100755
index 0000000..206e98a
--- /dev/null
+++ b/admin/schema_inc.php
@@ -0,0 +1,51 @@
+<?php
+
+$tables = [
+
+'liberty_content_role_map' => "
+ content_id I4 PRIMARY,
+ role_id I4 PRIMARY
+ CONSTRAINT ', CONSTRAINT `protector_role_ref` FOREIGN KEY (`role_id`) REFERENCES `".BIT_DB_PREFIX."users_roles` (`role_id`)
+ , CONSTRAINT `protector_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)'
+",
+
+];
+
+global $gBitInstaller;
+
+foreach( array_keys( $tables ) AS $tableName ) {
+ $gBitInstaller->registerSchemaTable( PROTECTOR_PKG_NAME, $tableName, $tables[$tableName] );
+}
+
+$gBitInstaller->registerPackageInfo( PROTECTOR_PKG_NAME, [
+ 'description' => "Protector restricts access to content based on user roles.",
+ 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
+] );
+
+// ### Indexes
+//$indices = array (
+//);
+//$gBitInstaller->registerSchemaIndexes( PROTECTOR_PKG_NAME, $indices );
+
+// ### Sequences
+//$sequences = [
+// 'protector_security_id_seq' => [ 'start' => 1 ]
+//];
+//$gBitInstaller->registerSchemaSequences( PROTECTOR_PKG_NAME, $sequences );
+
+// ### Default UserPermissions
+$gBitInstaller->registerUserPermissions( PROTECTOR_PKG_NAME, [
+ [ 'bit_p_create_protector', 'Can create a protector', 'registered', PROTECTOR_PKG_NAME ],
+ [ 'bit_p_protector_edit', 'Can edit any protector', 'editors', PROTECTOR_PKG_NAME ],
+ [ 'bit_p_protector_admin', 'Can admin protector', 'editors', PROTECTOR_PKG_NAME ],
+ [ 'bit_p_read_protector', 'Can read protector', 'basic', PROTECTOR_PKG_NAME ],
+] );
+
+// ### Default Preferences
+$gBitInstaller->registerPreferences( PROTECTOR_PKG_NAME, [
+ [ PROTECTOR_PKG_NAME, 'protector_default_ordering','title_desc' ],
+ [ PROTECTOR_PKG_NAME, 'protector_list_content_id','y' ],
+ [ PROTECTOR_PKG_NAME, 'protector_list_title','y' ],
+ [ PROTECTOR_PKG_NAME, 'protector_list_description','y' ],
+ [ PROTECTOR_PKG_NAME, 'protector_single_role','y' ],
+] );