Indefero

Indefero Commit Details


Date:2008-11-25 02:38:10 (16 years 27 days ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:6bee793704e44dc8084b863edb54c98d2ab931f9
Parents: 70616a0c9521ca1e07671fd258e37adc519d0f95
Message:Added permission at the installation/upgrade for cleaner code.

The authorized user permission is added at the installation/upgrade step
to remove the code to remove the unncessary logic in the code.
Changes:

File differences

src/IDF/Form/TabsConf.php
7878
7979
8080
81
82
83
84
85
86
87
88
89
90
9181
9282
9383
}
// remove all the permissions
$perm = Pluf_Permission::getFromString('IDF.project-authorized-user');
if ($perm == false) {
// We do not have this perm for the moment in the system,
// so create it.
$perm = new Pluf_Permission();
$perm->name = 'Project authorized users';
$perm->code_name = 'project-authorized-user';
$perm->description = 'Permission given to users allowed to access a project.';
$perm->application = 'IDF';
$perm->create();
}
$cm = $this->project->getMembershipData();
$guser = new Pluf_User();
foreach ($cm['authorized'] as $user) {
src/IDF/Migrations/6PrivateProject.php
3737
3838
3939
40
41
42
43
44
45
4046
4147
4248
4349
50
51
4452
4553
4654
......
5159
5260
5361
62
5463
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
$perm = new Pluf_Permission();
$perm->name = 'Project authorized users';
$perm->code_name = 'project-authorized-user';
$perm->description = 'Permission given to users allowed to access a project.';
$perm->application = 'IDF';
$perm->create();
}
function IDF_Migrations_6PrivateProject_down($params=null)
{
$perm = Pluf_Permission::getFromString('IDF.project-authorized-user');
if ($perm) $perm->delete();
$table = Pluf::factory('IDF_Project')->getSqlTable();
$sql = array();
$sql['PostgreSQL'] = 'ALTER TABLE '.$table.' DROP COLUMN "private"';
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
}
src/IDF/Migrations/Install.php
6262
6363
6464
65
66
67
68
69
70
6571
6672
6773
......
7076
7177
7278
79
80
7381
7482
7583
$perm->description = 'Permission given to project owners.';
$perm->application = 'IDF';
$perm->create();
$perm = new Pluf_Permission();
$perm->name = 'Project authorized users';
$perm->code_name = 'project-authorized-user';
$perm->description = 'Permission given to users allowed to access a project.';
$perm->application = 'IDF';
$perm->create();
}
function IDF_Migrations_Install_teardown($params=null)
if ($perm) $perm->delete();
$perm = Pluf_Permission::getFromString('IDF.project-owner');
if ($perm) $perm->delete();
$perm = Pluf_Permission::getFromString('IDF.project-authorized-user');
if ($perm) $perm->delete();
$models = array(
'IDF_WikiRevision',
'IDF_WikiPage',

Archive Download the corresponding diff file

Page rendered in 0.09731s using 13 queries.