1515require_once ("xml.inc.php " );
1616require_once ("keywordsEnv.php " );
1717
18- testlinkInitPage ($ db );
18+ testlinkInitPage ($ db, false , false , " checkRights " );
1919$ templateCfg = templateConfiguration ();
2020$ args = init_args ($ db );
2121$ gui = initializeGui ($ args );
@@ -46,17 +46,7 @@ function init_args(&$dbHandler) {
4646 throw new Exception ("Error Invalid Test Project ID " , 1 );
4747 }
4848
49- // Check rights before doing anything else
50- // Abort if rights are not enough
5149 $ args ->user = $ _SESSION ['currentUser ' ];
52- $ env ['tproject_id ' ] = $ args ->tproject_id ;
53- $ env ['tplan_id ' ] = 0 ;
54-
55- $ check = new stdClass ();
56- $ check ->items = array ('mgt_view_key ' );
57- $ check ->mode = 'and ' ;
58- checkAccess ($ dbHandler ,$ args ->user ,$ env ,$ check );
59-
6050 $ tproj_mgr = new testproject ($ dbHandler );
6151 $ dm = $ tproj_mgr ->get_by_id ($ args ->tproject_id ,array ('output ' => 'name ' ));
6252 $ args ->tproject_name = $ dm ['name ' ];
@@ -131,4 +121,8 @@ function exportKeywordsToCSV($kwSet) {
131121 $ keys = array ( "keyword " ,"notes " ,"tcv_qty " );
132122 $ csv = exportDataToCSV ($ kwSet ,$ keys ,$ keys ,array ('addHeader ' => 1 ));
133123 return $ csv ;
134- }
124+ }
125+
126+ function checkRights (&$ db ,&$ user ) {
127+ return ($ user ->hasRightOnProj ($ db ,'mgt_view_key ' ));
128+ }
0 commit comments