Code
// Build a permission that allows all members of the Users group to add
// items. This means that, by default, logged in users can register
// themselves as producers and begin uploading their music.
// TODO: remove this permission when the module is deleted.
$lhPermission = array( type => 'group',
realm => 0,
id => 'Users',
component => 'Dubplate::',
instance => '::',
level => ACCESS_ADD );
if( !pnModAvailable( 'Permissions' ) )
{
// TODO: error... permissions module not active
die( 'Perms unavailable.' );
}
if( !pnModLoad( 'Permissions', 'adminapi' ) )
{
// TODO: error... couln't load admin API
die( 'Perms admin api did not load.' );
}
if( !pnModAPIFunc( 'Permissions', 'adminapi', 'create', $lhPermission ) )
{
// TODO: error... couldn't add permission
return false;
}
// items. This means that, by default, logged in users can register
// themselves as producers and begin uploading their music.
// TODO: remove this permission when the module is deleted.
$lhPermission = array( type => 'group',
realm => 0,
id => 'Users',
component => 'Dubplate::',
instance => '::',
level => ACCESS_ADD );
if( !pnModAvailable( 'Permissions' ) )
{
// TODO: error... permissions module not active
die( 'Perms unavailable.' );
}
if( !pnModLoad( 'Permissions', 'adminapi' ) )
{
// TODO: error... couln't load admin API
die( 'Perms admin api did not load.' );
}
if( !pnModAPIFunc( 'Permissions', 'adminapi', 'create', $lhPermission ) )
{
// TODO: error... couldn't add permission
return false;
}
It dies silently, I think due to the argument values. I've been trying to use the argument values for pnSecAuthAction(), and the argument array is based on the function signature. Any ideas on what arg values I should use? I've had a look at the permissions module code but it's fairly opaque.
