ModuleFactoryFindAllForUser Method |
Find all allowed modules for the specified user.
Namespace:
AskiaPortalCmn
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static IEnumerable<IModule> FindAllForUser(
IContext context,
IUser user
)
Public Shared Function FindAllForUser (
context As IContext,
user As IUser
) As IEnumerable(Of IModule)
public:
static IEnumerable<IModule^>^ FindAllForUser(
IContext^ context,
IUser^ user
)
Parameters
- context
- Type: AskiaPortalCmnIContext
Context of execution. - user
- Type: AskiaPortalCmnIUser
User for who to find allowed modules.
Return Value
Type:
IEnumerableIModuleReturn an object to iterate through the list of modules.
Examples
Find all allowed modules for the user.
var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
throw contextValidation.Exception;
}
var modules = ModuleFactory.FindAllForUser(context, context.User);
foreach(IModule module in modules)
{
Console.WriteLine($"Module Guid={module.Guid}: {module.Name}");
}
See Also