//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;

namespace CommunityServer.Galleries.Components
{
	/// <summary>
	/// Summary description for WeblogPermissions.
	/// </summary>
	public class GalleryPermissions
	{
		private GalleryPermissions() { }

		/// <summary>
		/// Returns a list of GalleryPermissions for the selected Weblog
		/// </summary>
		/// <param name="galleryID"></param>
		/// <returns></returns>
		public static ArrayList GetGalleryPermissions(int galleryID)
		{
			return GalleryDataProvider.Instance().GetGalleryPermissions(galleryID);
		}

		/// <summary>
		/// Returns the WeblogPermission that matches the weblogId and RoleId
		/// </summary>
		public static GalleryPermission GetGalleryPermission(int galleryID, Guid roleId)
		{
			ArrayList list = GetGalleryPermissions(galleryID);
			foreach(GalleryPermission perm in list)
				if(perm.RoleID == roleId)
					return perm;
			return null;
		}
	}
}
