Jump to content

Sitemap generator and permissions requirement?


CodingJungle

Recommended Posts

this is a new one for me, 

SELECT * FROM `pro_babble_rooms` AS `babble_rooms`  LEFT JOIN `pro_core_permission_index` AS `core_permission_index` ON core_permission_index.app='babble' AND core_permission_index.perm_type='rooms' AND core_permission_index.perm_type_id=babble_rooms.rooms_id WHERE (( FIND_IN_SET(2,perm_) ) OR perm_='*' )
Unknown column 'perm_' in 'where clause'

this is cause by line 201 in /applications/core/extensions/core/sitemap/Content.php:

$select = new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', $nodeClass::$databaseTable, array( '(' . \IPS\Db::i()->findInSet( "perm_{$nodeClass::$permissionMap['read']}", array( \IPS\Settings::i()->guest_group ) ) . ' OR ' . "perm_{$nodeClass::$permissionMap['read']}=? )", '*' ) )->join( 'core_permission_index', array( "core_permission_index.app=? AND core_permission_index.perm_type=? AND core_permission_index.perm_type_id={$nodeClass::$databaseTable}.{$nodeClass::$databasePrefix}{$nodeClass::$databaseColumnId}", $nodeClass::$permApp, $nodeClass::$permType ) ), $nodeClass );

i wasn't aware "read" was required to be in the permission map. this seems to have started happening when i upgraded to 4.2.3, so i am assuming it is a undocumented change? 

Link to comment
Share on other sites

The line in question has been the same since Dec 29 2015 (I had to dig through git history to confirm). :)

Quote

Some keys are required if your models implement certain other functionality:

  • view (can see the node) is always required (defined as the value 'view')
  • read (can read content items) is always required
  • add (can add content items) is always required
  • reply (can reply to content items) is required if your content items can be commented on
  • review (can review content items) is required if your content items support reviews

Note that our documentation states 'read' is always required if you implement permissions in your nodes.

Link to comment
Share on other sites

  • 1 month later...

I've the same problem with Awards app.

In my case I've:

    /**
     * @var array
     */
    public static $permissionMap = array(
        'view'     => 'view',
        'add'      => 2,
        'receive'  => 3,
        'self'     => 4,
        'restrict' => 5,
        'manage'   => 6,
        'awarded'  => 7
    );

It's enough add read in this way?

    /**
     * @var array
     */
    public static $permissionMap = array(
        'view'     => 'view',
        'add'      => 2,
        'receive'  => 3,
        'self'     => 4,
        'restrict' => 5,
        'manage'   => 6,
        'awarded'  => 7,
        'read'     => 8
    );

 

Link to comment
Share on other sites

24 minutes ago, InvisionHQ said:

I've the same problem with Awards app.

In my case I've:


    /**
     * @var array
     */
    public static $permissionMap = array(
        'view'     => 'view',
        'add'      => 2,
        'receive'  => 3,
        'self'     => 4,
        'restrict' => 5,
        'manage'   => 6,
        'awarded'  => 7
    );

It's enough add read in this way?


    /**
     * @var array
     */
    public static $permissionMap = array(
        'view'     => 'view',
        'add'      => 2,
        'receive'  => 3,
        'self'     => 4,
        'restrict' => 5,
        'manage'   => 6,
        'awarded'  => 7,
        'read'     => 8
    );

 

 

yes

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...