|
||
|
API examples for newer versions Please visit the latest API Examples documentation to view API examples for newer versions of Kentico. |
The following example adds the cmseditor user to the current user's ignore list.
private bool AddUserToIgnoreList() { // Gets "cmseditor" UserInfo object UserInfo user = UserInfoProvider.GetUserInfo("cmseditor");
if (!IgnoreListInfoProvider.IsInIgnoreList(CMSContext.CurrentUser.UserID, user.UserID)) { // Adds "cmseditor" to the current user's ignore list IgnoreListInfoProvider.AddToIgnoreList(CMSContext.CurrentUser.UserID, user.UserID);
return true; }
return false; } |
The following example removes the cmseditor user from the current user's ignore list.
private bool RemoveUserFromIgnoreList() { // Gets "cmseditor" UserInfo object UserInfo user = UserInfoProvider.GetUserInfo("cmseditor");
if (IgnoreListInfoProvider.IsInIgnoreList(CMSContext.CurrentUser.UserID, user.UserID)) { // Removes "cmseditor" from the current user's ignore list IgnoreListInfoProvider.RemoveFromIgnoreList(CMSContext.CurrentUser.UserID, user.UserID);
return true; }
return false; } |