summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-15 18:04:16 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-15 18:04:16 +0100
commit5634d9a70d7431c583d28fc7d6ca6880cfa04e72 (patch)
treefa4b347377d5c1d2d46f2c6afdc7edba9f03e740
parentc8aba9e4d5ff8fd2f13ec4e96c206c726df568b0 (diff)
downloadliberty-5634d9a70d7431c583d28fc7d6ca6880cfa04e72.tar.gz
liberty-5634d9a70d7431c583d28fc7d6ca6880cfa04e72.tar.bz2
liberty-5634d9a70d7431c583d28fc7d6ca6880cfa04e72.zip
Further trimming of role_model selection
-rwxr-xr-xadmin/schema_inc.php27
-rwxr-xr-xtemplates/service_content_icon_inc.tpl6
2 files changed, 10 insertions, 23 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index bc56c89..55ceb25 100755
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -220,15 +220,13 @@ $tables = [
];
-if ( defined( 'ROLE_MODEL' ) ) {
- $tables['liberty_content_permissions'] =
- " role_id I4 PRIMARY,
- perm_name C(30) PRIMARY,
- content_id I4 PRIMARY,
- is_revoked C(1)
- CONSTRAINT ' , CONSTRAINT `liberty_content_id_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`) '
- ";
-}
+$tables['liberty_content_permissions'] =
+" role_id I4 PRIMARY,
+ perm_name C(30) PRIMARY,
+ content_id I4 PRIMARY,
+ is_revoked C(1)
+ CONSTRAINT ' , CONSTRAINT `liberty_content_id_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`) '
+";
global $gBitInstaller;
@@ -238,9 +236,8 @@ foreach( array_keys( $tables ) AS $tableName ) {
// Constraints which must be installed after table creation
$constraints = [
- 'liberty_content_permissions' => [ 'liberty_content_perm_group_ref' => 'FOREIGN KEY (`group_id`) REFERENCES `' . BIT_DB_PREFIX . 'users_groups` (`group_id`)' ],
+ 'liberty_content_permissions' => [ 'liberty_content_perm_role_ref' => 'FOREIGN KEY (`role_id`) REFERENCES `' . BIT_DB_PREFIX . 'users_roles` (`role_id`)' ],
'liberty_process_queue' => [ 'liberty_process_queue_ref' => 'FOREIGN KEY (`content_id`) REFERENCES `' . BIT_DB_PREFIX . 'liberty_content`( `content_id` )' ],
-
];
// ### Indexes
@@ -262,7 +259,7 @@ $indices = [
'to_content_id_idx' => [ 'table' => 'liberty_content_links', 'cols' => 'to_content_id', 'opts' => null ],
'links_from_content_id_idx' => [ 'table' => 'liberty_content_links', 'cols' => 'from_content_id', 'opts' => null ],
'links_title_content_id_idx' => [ 'table' => 'liberty_content_links', 'cols' => 'to_title', 'opts' => null ],
- 'liberty_content_perm_group_idx' => [ 'table' => 'liberty_content_permissions', 'cols' => 'group_id', 'opts' => null ],
+ 'liberty_content_perm_role_idx' => [ 'table' => 'liberty_content_permissions', 'cols' => 'role_id', 'opts' => null ],
'liberty_content_perm_perm_idx' => [ 'table' => 'liberty_content_permissions', 'cols' => 'perm_name', 'opts' => null ],
'liberty_content_perm_cont_idx' => [ 'table' => 'liberty_content_permissions', 'cols' => 'content_id', 'opts' => null ],
'process_id_idx' => [ 'table' => 'liberty_process_queue', 'cols' => 'content_id', 'opts' => null ],
@@ -271,12 +268,6 @@ $indices = [
'lib_attachment_meta_title_idx' => [ 'table' => 'liberty_attachment_meta_data', 'cols' => 'meta_title_id', 'opts' => null ],
];
-if ( defined( 'ROLE_MODEL' ) ) {
- $constraints['liberty_content_permissions'] = ['liberty_content_perm_role_ref' => 'FOREIGN KEY (`role_id`) REFERENCES `'.BIT_DB_PREFIX.'users_roles` (`role_id`)'];
- unset($indices['liberty_content_perm_group_idx']);
- $indices['liberty_content_perm_role_idx'] = [ 'table' => 'liberty_content_permissions', 'cols' => 'role_id', 'opts' => null ];
-
-}
foreach( array_keys($constraints) AS $tableName ) {
$gBitInstaller->registerSchemaConstraints( LIBERTY_PKG_NAME, $tableName, $constraints[$tableName]);
}
diff --git a/templates/service_content_icon_inc.tpl b/templates/service_content_icon_inc.tpl
index c74062d..04cd0f8 100755
--- a/templates/service_content_icon_inc.tpl
+++ b/templates/service_content_icon_inc.tpl
@@ -17,11 +17,7 @@
{else}
{assign var=iconClass value=""}
{/if}
- {if $smarty.const.ROLE_MODEL }
- {smartlink ipackage=liberty ifile="content_role_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id=$serviceHash.content_id}
- {else}
- {smartlink ipackage=liberty ifile="content_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id=$serviceHash.content_id}
- {/if}
+ {smartlink ipackage=liberty ifile="content_role_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id=$serviceHash.content_id}
{/if}
{/if}
{/strip}