예제 #1
0
파일: DataApiModule.cs 프로젝트: shchy/tips
        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;
        }