...
 
Commits (3)
......@@ -21,6 +21,6 @@ export enum Flags {
SUBSCRIBE = 'subscribe',
TAG = 'tag',
REMIND = 'remind',
VIEW = 'wire',
VIEW = 'view',
VOTE = 'vote',
}
......@@ -50,7 +50,7 @@
<div
class="mdl-grid channel-grid m-channel--closed"
style="max-width:900px"
*ngIf="user && !user.blocked && !user.subscribed && user.mode !== 0"
*ngIf="user && !user.blocked && !user.subscribed && !canView"
>
<div class="m-groupSplash__avatar">
<minds-avatar [object]="user"></minds-avatar>
......@@ -87,7 +87,7 @@
<div
class="mdl-grid channel-grid"
style="max-width:990px"
*ngIf="user && !user?.blocked && (user.mode === 0 || user.subscribed)"
*ngIf="user && !user?.blocked && canView"
>
<section class="mdl-cell mdl-cell--4-col m-channel-sidebar">
<m-channel--sidebar
......@@ -164,7 +164,10 @@
</section>
<!-- Subscriptions list -->
<section class="mdl-cell mdl-cell--8-col" *ngIf="filter == 'subscribers'">
<section
class="mdl-cell mdl-cell--8-col"
*ngIf="filter == 'subscribers' || filter == 'requests'"
>
<div class="mdl-card m-channel--subscribers-tabs">
<div class="mdl-tabs__tab-bar">
<a
......
......@@ -19,6 +19,7 @@ import { BlockListService } from '../../common/services/block-list.service';
import { ChannelSortedComponent } from './sorted/sorted.component';
import { PermissionsService } from '../../common/services/permissions/permissions.service';
import { ClientMetaService } from '../../common/services/client-meta.service';
import { Flags } from '../../common/services/permissions/flags';
@Component({
moduleId: module.id,
......@@ -44,6 +45,10 @@ export class ChannelComponent {
@ViewChild('feed', { static: false }) private feed: ChannelSortedComponent;
get canView() {
return this.permissions.canInteract(this.user, Flags.VIEW);
}
constructor(
public session: Session,
public client: Client,
......
......@@ -146,10 +146,21 @@
"environment" => getenv('MINDS_ENV') ?: 'development',
];
if(Minds\Core\Session::isLoggedIn()){
$minds['user'] = Minds\Core\Session::getLoggedinUser()->export();
$minds['user']['rewards'] = !!Minds\Core\Session::getLoggedinUser()->getPhoneNumberHash();
$minds['wallet'] = array('balance' => Minds\Helpers\Counters::get(Minds\Core\Session::getLoggedinUser()->guid, 'points', false));
if (Minds\Core\Session::isLoggedIn()) {
$user = Minds\Core\Session::getLoggedinUser();
$minds['user'] = $user->export();
$minds['user']['rewards'] = !!Minds\Core\Session::getLoggedinUser()->getPhoneNumberHash();
$minds['wallet'] = array('balance' => Minds\Helpers\Counters::get(Minds\Core\Session::getLoggedinUser()->guid, 'points', false));
if(Minds\Core\Di\Di::_()->get('Features\Manager')->has('permissions')) {
/** @var Minds\Core\Permissions\Manager $permissionsManager */
$permissionsManager = Minds\Core\Di\Di::_()->get('Permissions\Manager');
$permissions = $permissionsManager->getList([
'user_guid' => $user,
'entities' => [$user],
]);
$minds['user']['permissions'] = $permissions->exportPermission($user->getGuid());
}
}
if (__MINDS_CONTEXT__ === 'embed') {
......@@ -158,6 +169,6 @@
?>
window.Minds = <?= json_encode($minds) ?>;
</script>
</body>
</html>