
Safe modules in XMLNuke How to configure a module?
How to configure a module so that it requires authentication and how to define a role that this module supports. Techniques for personalizing the authentication routine.
Table of contents 1. How does validation for secure modules work? 2. Creating Users and Associating Roles 3. How to configure a module? 4. Creating your own Login module 5. How to create your own validation mechanism
On this page The Default Way Personalizing the method for user validation
The Default Way
To configure a module so that it requires authentication, the following methods must be overwritten:
CSharp
public override bool requiresAuthentication()
{
return true;
}
public override AccessLevel getAccessLevel()
{
return AccessLevel.OnlyAdmin; // See first topic for other methods of access
}
public override string getRole()
{
// Specify WHICH role this module supports.
// Only if getAccessLevel() is setted to OnlyRole or CurrentSiteAndRole
return "";
}
PHP
public function requiresAuthentication()
{
return true;
}
public function getAccessLevel()
{
return AccessLevel::OnlyAdmin; // See first topic for other methods of access
}
public function getRole()
{
// Especifique QUAL o papel que esse módulo suporta.
// Only if getAccessLevel() is setted to OnlyRole or CurrentSiteAndRole
return "";
}
XMLNuke automatically understands that the module requires authentication and will make the necessary request to guarantee that only the users that meet the configurations have access to the modules.
.
Personalizing the method for user validation
In some cases the user validation method does not meet the default configurations of XMLNuke, like when using LDAP or integrating it to existing validation systems. In these cases it is necessary to implement your own validation method.
To do this, we must overwrite the accessGranted() method. It is important that this method returns TRUE or FALSE.
|