private bool IsEnableUser(IDataBaseContext context, IPermission permission) { var query = from current in this.Context.CurrentUser.ToMaybe() from name in current.UserName.ToMaybe() from user in (from u in context.GetUser(x => x.Id.Equals(name)) select u).FirstOrNothing() where permission.IsPermittedUser(user) select true; return query.IsSomething; }