Click here to Skip to main content
15,896,118 members
Articles / Database Development / SQL Server

A Fairly Capable Authorization Sub-System with Row-Level Security Capabilities (AFCAS)

Rate me:
Please Sign up or sign in to vote.
4.84/5 (23 votes)
12 Feb 2009LGPL325 min read 102.1K   1.1K   78  
An implementation of role-based authorization control (RBAC) model with row-level access control capabilities at the database server level
#region copyright

// Copyright (C) 2008 Kemal ERDOGAN
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, version 3 of the License.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#endregion

namespace Afcas {
    using System.Collections.Generic;
    using Objects;

    /// <summary>
    /// The main interface to be used by the clients that need to make authorization decisions.
    /// An instance of this interface is provided by <see cref="Afcas"/> class.
    /// </summary>
    public interface IAuthorizationProvider {
        // the method to justify the existence of this interface
        bool IsAuthorized( string principalId, string operationId, ResourceHandle resource );

        // these method also have uses for authorization purposes
        bool IsMemberOf( string groupId, string memberId );
        bool IsSubOperation( string opId, string subOpId );
        bool IsSubResource( ResourceHandle resource, ResourceHandle subResource );

        // These two methods are for offline support
        IList< ResourceAccessPredicate > GetAuthorizationDigest( string principalId );
        IList< Operation > GetAuthorizedOperations( string principalId, ResourceHandle resource );

        // This can be used to allow the user to browse authorized resources
        IList< ResourceHandle > GetAuthorizedResources( string principalId, string operationId );
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions