Пример #1
0
		private bool Grant(string packageName, XmlNode xmlData, UserDto user)
		{
			var dto = new User2AppDto()
			{
				UserId = user.Id,
				AppAlias = packageName.ToLowerInvariant()
			};

			LogHelper.Info<GrantPermissionForApp>("Granting permission to " + packageName.ToLowerInvariant() + " for user Id " + user.Id);

			_database.Insert(dto);

			return true;
		}
Пример #2
0
        private bool Revoke(string packageName, XmlNode xmlData, UserDto user)
        {
            try
            {
                _database.Execute("DELETE FROM umbracoUser2app WHERE app = @package", new { package = packageName.ToLowerInvariant()});

                return true;
            }
            catch (SqlHelperException ex)
            {
                LogHelper.Error<GrantPermissionForApp>(string.Format("Error in Grant User Permission for App action for package {0}.", packageName), ex);
            }

            return false;
        }