function brightcove_permission in Brightcove Video Connect 7.6
Same name and namespace in other branches
- 7.7 brightcove.module \brightcove_permission()
- 7.2 brightcove.module \brightcove_permission()
- 7.3 brightcove.module \brightcove_permission()
- 7.4 brightcove.module \brightcove_permission()
- 7.5 brightcove.module \brightcove_permission()
Implements hook_permission().
File
- ./
brightcove.module, line 2198 - Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.
Code
function brightcove_permission() {
$permissions = [
'administer brightcove settings' => [
'title' => t('Administer brightcove'),
],
'browse videos' => [
'title' => t('Browse videos'),
],
'upload videos' => [
'title' => t('Upload videos'),
],
'browse playlists' => [
'title' => t('Browse playlists'),
],
'administer brightcove playlists' => [
'title' => t('Administer playlists'),
],
];
// There's a separate permission for each brightcove client to use them.
$clients = db_select('brightcove_client', 'bc')
->fields('bc', [
'bcid',
'label',
])
->execute()
->fetchAllKeyed();
foreach ($clients as $bcid => $label) {
$permissions['use brightcove client ' . $bcid] = [
'title' => t('Use the @label client', [
'@label' => $label,
]),
];
}
return $permissions;
}