Changeset 6507

Show
Ignore:
Timestamp:
12/28/07 00:46:18 (7 months ago)
Author:
ryan
Message:

Some cap checks for app from josephscott.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-app.php

    r6505 r6507  
    164164    function get_service() { 
    165165        log_app('function','get_service()'); 
     166 
     167        if( !current_user_can( 'edit_posts' ) )  
     168            $this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) ); 
     169 
    166170        $entries_url = attribute_escape($this->get_entries_url()); 
    167171        $categories_url = attribute_escape($this->get_categories_url()); 
     
    193197 
    194198    function get_categories_xml() { 
    195  
    196199        log_app('function','get_categories_xml()'); 
     200 
     201        if( !current_user_can( 'edit_posts' ) )  
     202            $this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) ); 
     203 
    197204        $home = attribute_escape(get_bloginfo_rss('home')); 
    198205 
     
    286293 
    287294    function get_post($postID) { 
    288  
    289295        global $entry; 
     296 
     297        if( !current_user_can( 'edit_post', $postID ) ) 
     298            $this->auth_required( __( 'Sorry, you do not have the right to access this post.' ) );  
     299 
    290300        $this->set_current_entry($postID); 
    291301        $output = $this->get_entry($postID); 
     
    373383 
    374384    function get_attachment($postID = NULL) { 
     385        if( !current_user_can( 'upload_files' ) ) 
     386            $this->auth_required( __( 'Sorry, you do not have the right to file uploads on this blog.' ) ); 
     387 
    375388        if (!isset($postID)) { 
    376389            $this->get_attachments();