add permission controls to "storage" objects such as attachments or other stored files

This commit is contained in:
friendica
2012-12-22 03:33:12 -08:00
parent 8d71fe91f6
commit f09b9f1e44
7 changed files with 27 additions and 5 deletions

View File

@@ -159,6 +159,8 @@ CREATE TABLE IF NOT EXISTS `channel` (
`channel_w_photos` tinyint(3) unsigned NOT NULL DEFAULT '128',
`channel_w_chat` tinyint(3) unsigned NOT NULL DEFAULT '128',
`channel_a_delegate` tinyint(3) unsigned NOT NULL DEFAULT '0',
`channel_r_storage` int(10) unsigned NOT NULL DEFAULT '128',
`channel_w_storage` int(10) unsigned NOT NULL DEFAULT '128',
PRIMARY KEY (`channel_id`),
KEY `channel_account_id` (`channel_account_id`),
KEY `channel_primary` (`channel_primary`),
@@ -186,7 +188,9 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_guid` (`channel_guid`),
KEY `channel_hash` (`channel_hash`),
KEY `channel_expire_days` (`channel_expire_days`),
KEY `channel_a_delegate` (`channel_a_delegate`)
KEY `channel_a_delegate` (`channel_a_delegate`),
KEY `channel_r_storage` (`channel_r_storage`),
KEY `channel_w_storage` (`channel_w_storage`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `clients` (

View File

@@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1007 );
define( 'UPDATE_VERSION' , 1008 );
/**
*
@@ -142,4 +142,13 @@ function update_r1006() {
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}
function update_r1007() {
$r = q("ALTER TABLE `channel` ADD `channel_r_storage` INT UNSIGNED NOT NULL DEFAULT '128', ADD `channel_w_storage` INT UNSIGNED NOT NULL DEFAULT '128', add index ( channel_r_storage ), add index ( channel_w_storage )");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}