IUserModules Property |
Namespace: AskiaPortalCmn
This example looks if the user in the context can access the `home` module.
using system; using AskiaPortalCmn; namespace MyApp { class Program { static void Main(string[] args) { var context = ContextFactory.CreateByLoginAndPassword("login", "secret"); var contextValidation = context.Validate(); if (!contextValidation.Success) { Console.Error.Write(contextValidation.Exception.Message); return; } Guid homeModuleGuid = Guid.Parse("9821219b-0768-41cc-81d8-cf3b1ade9317"); if (context.User.Modules.CanAccess(homeModuleGuid)) { Console.WriteLine("You're allowed to access the `Home` module!"); } else { Console.WriteLine("You're NOT allowed to access the `Home` module!"); } } } }