From: Jamie C. <jca...@we...> - 2003-01-01 03:57:39
|
Marco Rebsamen wrote: > > I search more information about the ACL Programming for a webmin modul. > I've read the "Writing Webmin Modules" Document on webmin.com but it sill > can't figure out how it works! Basically, the get_module_acl function returns a hash contain values from the /etc/webmin/<modulename>/<username>.acl , or the defaultacl in the module CGI programs directory if the .acl file does not exist. The .acl files for users are created using the Webmin Users module, using forms in the acl_security.pl script in the module directory. This script must contain two perl functions : acl_security_form which takes a hash referernce to existing ACL variables for the user as a parameter and must output HTML for a form for editing them. acl_security_save which takes the same hash refererence as a parameter, but must set the values in it based on the form inputs (available in %in). Finally, module CGI programs should contain code like : %access = get_module_acl(); if ($access{'canedit'}) { # Allow the user to edit something .. } - Jamie |