The best way to show code in your blog

Forget what I said earlier... get this:

http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/

This is a much better solution.

For example:

        public IQueryable<Property> SecuredProperties

        {

            get

            {

                IQueryable<Property> q;

 

                //if the user is an admin, bypass security

                if (_Service.CurrentUser.IsAdmin)

                    q = from o in this.Organizations

                            from p in o.Properties

                            where

                                p.Deleted == 0

                                && o.Deleted == 0

                            select p;

                else

                    //get properties based on security

                    q = from o in this.Organizations

                            from vp in o.ViewPermissions

                            from p in o.Properties

                            where

                                vp.UserGUID == _Service.CurrentUser.Id

                                && vp.ObjectType == 105

                                && vp.View == 2

                                && p.Deleted == 0

                                && o.Deleted == 0

                            select p;

 

 

                return q;

 

            }

        }

Published Thursday, November 23, 2006 8:45 AM by wwright

Comments

Thursday, November 23, 2006 11:48 AM by aapol

# re: The best way to show code in your blog

Leave a Comment

(required) 
(required) 
(optional)
(required)