We went twice last year. i took a dslr and a 50mm and a fuji x10 compact. Both were absolutely fine. Security wise, you'll be good, obviously as always anywhere, be aware but its is no better of worse than any other city.
OK, photos - DON'T try taking photos in the main square of the monkeys/snake charmers, etc unless you want to be seriously hassled by their owners for money. However, all over Morocco and especially in Marrakech, there are plain clothes 'tourist police' keeping an eye on things and trying to ensure you don't get too much grief. You will also find as you walk around the medina, you will get a lot of people trying to be your guide - remember, these people are just trying to make a living, so be very firm but polite with them when saying no - they will all eventually lead you to the carpet shop/pharmacy that is giving them commision and they will all tell you they are not guides and they dont want paying until you get there....
Anywhere else, we found people were fine if you were taking pics of goods on stalls, that kind of thing, but for people, some wont want it at all, others will hold out their hand for a dirham or two, and some will be fine, though evwn those that are ok with it, its polite to offer a coin. What I found very quickly was that having the camera round my neck [something I never normally do], and shooting surreptitiously from the 'hip' [ok, midriff], got me the natural street scenes I wanted far more easily. If you are looking for 'portraits' you will have to be prepared to be told no probably more often than yes. It's a muslim country and as such, they aren't fond of pictures, but that is balanced by quite liking the tourist money ;-)
MUST SEE - the photography museum - the photos in there are lovely enough, but the cafe on the roof has the best food anywhere in Marrakech and the view across the rooftops, almost a full 360 degree, is simply unmissable!! Stay there for at least one muezzin call too, and watch and listen as each mosque competes with the next across the city. It costs a few dirham to get in, but hang on to your ticket and you can go back again with it.
The Majorelle gardens are nice enough, worth a trip if you have time but don't go out of your way if you haven't.
Learn the way to and from your Riad as quick as you can, because you will get lost! I promise
Most of all, have a fab time! I LOVE Marrakeck [and Morocco generally], love its people who are generally warm and friendly, the culture, everything. Oh yes and finally, barter HARD in the souks or walk away, they will respect you for either
If you are interested, these are some of my marrakech pics from May last year
http://www.flickr.com/photos/wgi/sets/72157633762929806/
Oh and staying in a riad in the middle of it is the best way to see the place [we have done riad and outskirts modern hotel]