You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by arvind-narain <gi...@git.apache.org> on 2015/09/01 03:47:45 UTC

[GitHub] incubator-trafodion pull request: [TRAFODION-353][TRAFODION-1200][...

Github user arvind-narain commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/69#discussion_r38379061
  
    --- Diff: core/sql/sqlcomp/PrivMgrPrivileges.cpp ---
    @@ -4407,6 +4609,60 @@ static void getColRowsForGranteeGrantor(
     
     
     // *****************************************************************************
    +// * Function: hasAllDMLPrivs                                                  *
    +// *                                                                           *
    +// *    This function determines if a privilege bitmap has all the DML         *
    +// * privileges for a specified object type.                                   *
    +// *                                                                           *
    +// *****************************************************************************
    +// *                                                                           *
    +// *  Parameters:                                                              *
    +// *                                                                           *
    +// *  <objectType>                 ComObjectType                      In       *
    +// *    is the type of the object.                                             *
    +// *                                                                           *
    +// *  <privBitmap>                 PrivObjectBitmap                   In       *
    +// *    is the bitmap representing the privileges.                             *
    +// *                                                                           *
    +// *****************************************************************************
    +static bool hasAllDMLPrivs(
    +   ComObjectType objectType,
    +   PrivObjectBitmap privBitmap)
    +
    +{
    +
    +   switch (objectType)
    +   {
    +      case COM_BASE_TABLE_OBJECT:
    +      case COM_VIEW_OBJECT:
    +         if (privBitmap.test(DELETE_PRIV) && privBitmap.test(INSERT_PRIV) &&
    +             privBitmap.test(REFERENCES_PRIV) && privBitmap.test(SELECT_PRIV) &&
    +             privBitmap.test(UPDATE_PRIV))
    +            return true;
    +         break;
    +      case COM_LIBRARY_OBJECT:
    +         if (privBitmap.test(UPDATE_PRIV) && privBitmap.test(USAGE_PRIV))
    +            return true;
    +         break;      
    +      case COM_STORED_PROCEDURE_OBJECT:
    +      case COM_USER_DEFINED_ROUTINE_OBJECT:
    +         if (privBitmap.test(EXECUTE_PRIV))
    +            return true;
    +      case COM_SEQUENCE_GENERATOR_OBJECT:
    --- End diff --
    
    Is a break needed here ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---