Commits

elem...@60038091-bd4c-0410-8356-ef1767570a53  committed f78245a

Guest Password

  • Participants
  • Parent commits ace4dc9

Comments (0)

Files changed (2)

File src/com/photobucket/webapi/interfaces/IAlbum.as

 		function move(albumTo:IAlbum):void;
 		function addChild(child:Object):void;
 		function addChildAt(object:Object, index:int = 0):void;
+		function setPrivacy(privacy:String, password:String = null):void
 	}
 }

File src/com/photobucket/webapi/objects/Album.as

 			}			
 		}
 		
+		
+		public function setPrivacy(privacy:String, password:String = null):void {
+			var request:IOAuthRequest = createRequest();
+			request.method = OAuthRequestMethod.PUT;
+			request.needsLogin = true;
+			request.addParameter("privacy", privacy);
+			if (password != null) {
+				request.addParameter("password", password);
+			}
+			request.url = server+"/album/" + id +"/privacy";
+			request.fault = this.fault;
+			request.result = function (result:Object):void {
+				_privacy = XML(result).privacy;
+				dispatchEvent(new Event('privacyUpdated'));
+			}
+			pbservice.makeRequest(request);			
+		}
+		
+		
 		internal function getCachedMediaByType(type:String):ArrayCollection {
 			if (_mediaTypes.hasOwnProperty(type) == false) {
 				_mediaTypes[type] = new ArrayCollection();