Develop and Download Open Source Software

Browse CVS Repository

Diff of /xoonips/AL/commonal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.66 by youi, Wed Feb 16 10:03:13 2005 UTC revision 1.67 by tani, Sat Feb 19 02:06:11 2005 UTC
# Line 2  Line 2 
2   *   *
3   * $Revision$   * $Revision$
4   * $Log$   * $Log$
5     * Revision 1.67  2005/02/19 02:06:11  tani
6     * 承認状態の権限チェックに作成者を追加.
7     *
8   * Revision 1.66  2005/02/16 10:03:13  youi   * Revision 1.66  2005/02/16 10:03:13  youi
9   * publication_year/month/mdayに対応.   * publication_year/month/mdayに対応.
10   *   *
# Line 4205  bool getCertifyPermission( sessionid_t s Line 4208  bool getCertifyPermission( sessionid_t s
4208          sql += " AND ti.item_id=" + unsignedIntToString( iid );          sql += " AND ti.item_id=" + unsignedIntToString( iid );
4209          sql += " AND tx.index_id=" + unsignedIntToString( xid );          sql += " AND tx.index_id=" + unsignedIntToString( xid );
4210          sql += " AND ( is_admin=1 AND tgulink.uid=" + unsignedIntToString( sess_uid );          sql += " AND ( is_admin=1 AND tgulink.uid=" + unsignedIntToString( sess_uid );
4211      sql += " OR item_type_id =" + unsignedIntToString( item::ITID_BINDER ); //すべてのバインダーを承認      sql += " OR item_type_id=" + unsignedIntToString( item::ITID_BINDER ); //すべてのバインダーを承認
4212        if( state == index_t::NOT_CERTIFIED )
4213            sql += " OR ti.uid=" + unsignedIntToString( sess_uid );
4214      sql += string( isModerator( sid, sess_uid ) ? " OR 1)" : " OR 0)" ); //モデレータならOR 1,それ以外は OR 0      sql += string( isModerator( sid, sess_uid ) ? " OR 1)" : " OR 0)" ); //モデレータならOR 1,それ以外は OR 0
4215      syslog_printf( "\nsql at %d=%s", __LINE__, sql.c_str() );      syslog_printf( "\nsql at %d=%s", __LINE__, sql.c_str() );
4216    
# Line 4213  bool getCertifyPermission( sessionid_t s Line 4218  bool getCertifyPermission( sessionid_t s
4218          return false;          return false;
4219      }      }
4220      return count > 0;      return count > 0;
   
 #if 0  
     //available if moderator  
     if( isModeratorBySession( sid ) ) return true;  
       
     const index_t* index;  
     if( getIndex( sid, xid, &index ) == RES_OK ){  
         //available for all users if index is binders  
         if( index -> getIndexID() == index::IID_BINDERS ){  
             freeIndex( index );  
             return true;  
         }  
         //  
         freeIndex( index );  
         userid_t sess_uid;  
         if( sessionID2UID( sid, &sess_uid ) == RES_OK ){  
             const item_t* item;  
             if( getItem( sid, iid, &item ) == RES_OK ){  
                 itemid_t item_uid = item -> getContributorUID( );  
                 freeItem( item );  
                 if( sess_uid == item_uid && state == index::NOT_CERTIFIED )  
                     return true;  
                 else if( index -> getOpenLevel( ) == index::OL_GROUP_ONLY  
                          && isGroupAdmin( sid, index -> getOwnerGID( ), sess_uid ) )  
                     return true;  
                 else if( index -> getOpenLevel( ) == index::OL_PUBLIC  
                          && isModeratorBySession( sid ) )  
                     return true;  
             }  
         }  
     }  
     return false;  
 #endif  
4221  }  }
4222    
4223  result_t getOverlappedItems( sessionid_t sid, indexid_t xid, item_t* item, itemid_t** iids, int* iidsLen ){ return RES_ERROR; }  result_t getOverlappedItems( sessionid_t sid, indexid_t xid, item_t* item, itemid_t** iids, int* iidsLen ){ return RES_ERROR; }

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26