book.cs

来自「本系统是在asp版《在线文件管理器》的基础上设计制作」· CS 代码 · 共 84 行

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

using System;
using CommunityServer.Components;

namespace CommunityServer.GuestBooks.Components
{
	/// <summary>
	/// Summary description for GuestBook.
	/// </summary>
	public class Book : Section
	{
		public Book()
		{
			this.ApplicationType = ApplicationType.GuestBook;
		}

		#region Private/Internal

		AccessCheckDelegate acd = null;
		ValidatePermissionsDelegate vpd = null;
		GuestBookPermission op = null;

		#endregion

		
		public override PermissionBase OwnerPermission
		{
			get
			{
				if(op == null)
				{
					op = new GuestBookPermission();
					op.SetBit(Permission.Post,AccessControlEntry.Allow);
					op.SetBit(Permission.Reply,AccessControlEntry.Allow);
					op.SetBit(Permission.View,AccessControlEntry.Allow);
				}
				return op;
			}
		}


		/// <summary>
		/// Each section type must return it's permission type
		/// </summary>
		public override PermissionBase DefaultRolePermission
		{
			get { return new GuestBookPermission(); }
		}

		/// <summary>
		/// Provides the Method implementing the AccessCheckDelegate signature
		/// </summary>
		public override AccessCheckDelegate AccessCheck
		{
			get
			{
				if(acd == null)
					acd = new AccessCheckDelegate(GuestBookPermission.AccessCheck);

				return acd;
			}
		}

		/// <summary>
		/// Provides the Method implementing the ValidateDelegate signature
		/// </summary>
		public override ValidatePermissionsDelegate ValidatePermissions
		{
			get
			{
				if(vpd == null)
					vpd = new ValidatePermissionsDelegate(GuestBookPermission.Validate);

				return vpd;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?