Posted on 30/07/2007 16:06:47
You can get information on the current user doing like this:
Session("DW_Admin_Login") holds True or false if the user is logged on or not
To get detailed information on the user currently logged on:
Dim usr As Backend.User
usr = Session("DW_Admin_User")
The Backend.User object will give you the details, like username, userid etc.
To check for permissions, you can do like this:
'To check if a user has access to a surden module:
If Base.HasAccess("News", "") Then
End If
'To check if a user has access to a surden Category in a module:
If Base.HasAccess("NewsCategories", drNews("NewsCategoryID")) Then
End If
To get the second option to work you need to specify some information in module table of Database Dynamic.mdb. You have to specify ModuleDatabase, ModuleTable, ModuleFieldID and ModuleFieldName with some database information. After you do this, the usermodule gives you the possibility to control access to different categories/areas of a module.
Note: The first variable in has access is either the systemname (checking for general access) or the systemname postfixed with "Categories" when checking for a surden category/area.