added methods to handle permissions of modules
implemented complete functionality of module.php into python