IReachableGroups Interface |
Namespace: AskiaPortalCmn.Common
The IReachableGroups type exposes the following members.
Name | Description | |
---|---|---|
IsModified |
Flag to indicates if the object
has been modified since his initialization.
|
Name | Description | |
---|---|---|
Add(IListInt32) |
Add groups to reach It will not save the change in the database unless you explicitly save the user/group. | |
Add(Int32) |
Add a group to reach. It will not save the change in the database unless you explicitly save the user/group. | |
Clear |
Clear the list of all reachable groups. It will not save the change in the database unless you explicitly save the user/group. | |
Contains |
Returns true if the user/group
can reach the group
with the specified id.
| |
GetAllIds |
Returns the entire list of group ids
reachable by the user/group.
| |
GetIds |
Returns the non-recursive list of group ids
reachable by the user/group
| |
Reload |
Reload the rechable groups
using the current database values.
| |
Remove(IListInt32) |
Remove groups from the reachability. It will not save the change in the database unless you explicitly save the user/group. | |
Remove(Int32) |
Remove a group from the reachability. It will not save the change in the database unless you explicitly save the user/group. | |
Save |
Save the modification in the database
if the object has been modified.
|
This example looks if the user in the context is allowed to reach the group with id 5
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.WriteLine("Invalid context"); Console.Error.Write(contextValidation.Exception.Message); return; } // Is allowed to reach the group 5? if (context.User.ReachableGroups.Contains(5)) { Console.WriteLine("You're allowed to reach the group 5!"); } else { Console.WriteLine("You're NOT allowed to reach the group 5!"); } } } }