using System;
using System.Collections.Generic;
using System.Text;
namespace ScrewTurn.Wiki.AclEngine {
///
/// Defines an interface for an ACL manager.
///
public interface IAclManager {
///
/// Stores a new ACL entry.
///
/// The controlled resource.
/// The action on the controlled resource.
/// The subject whose access to the resource/action is controlled.
/// The value of the entry.
/// true if the entry is stored, false otherwise.
/// If , or are null.
/// If , or are empty.
bool StoreEntry(string resource, string action, string subject, Value value);
///
/// Deletes an ACL entry.
///
/// The controlled resource.
/// The action on the controlled resource.
/// The subject whose access to the resource/action is controlled.
/// true if the entry is deleted, false otherwise.
/// If , or are null.
/// If , or are empty.
bool DeleteEntry(string resource, string action, string subject);
///
/// Deletes all the ACL entries for a resource.
///
/// The controlled resource.
/// true if the entries are deleted, false otherwise.
/// If is null.
/// If is empty.
bool DeleteEntriesForResource(string resource);
///
/// Deletes all the ACL entries for a subject.
///
/// The subject.
/// true if the entries are deleted, false otherwise.
/// If is null.
/// If is empty.
bool DeleteEntriesForSubject(string subject);
///
/// Renames a resource.
///
/// The resource.
/// The new name of the resource.
/// true if the resource is renamed, false otherwise.
/// If or are null.
/// If or are empty.
bool RenameResource(string resource, string newName);
///
/// Retrieves all the ACL entries for a resource.
///
/// The entries.
AclEntry[] RetrieveAllEntries();
///
/// Retrieves all the ACL entries for a resource.
///
/// The resource.
/// The entries.
/// If is null.
/// If is empty.
AclEntry[] RetrieveEntriesForResource(string resource);
///
/// Retrieves all the ACL entries for a subject.
///
/// The subject.
/// The entries.
/// If is null.
/// If is empty.
AclEntry[] RetrieveEntriesForSubject(string subject);
///
/// Initializes the manager data.
///
/// The ACL entries.
/// If is null.
void InitializeData(AclEntry[] entries);
///
/// Gets the total number of ACL entries.
///
int TotalEntries { get; }
///
/// Event fired when an ACL entry is stored or deleted.
///
event EventHandler AclChanged;
}
}