Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
864
Issues
864
List
Boards
Labels
Service Desk
Milestones
Merge Requests
46
Merge Requests
46
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
cddfe67e9fce1c1fed9b4791dcee2ee0876b975c...8b40f6091d98b5562e7fea022390550b1aeec152
Source
8b40f6091d98b5562e7fea022390550b1aeec152
Select Git revision
...
Target
cddfe67e9fce1c1fed9b4791dcee2ee0876b975c
Select Git revision
Compare
Commits (3)
(feat): include permissions in the injected user
· 295c053a
Marcelo Rivera
authored
1 hour ago
295c053a
(fix): Flags.view should be 'view'
· 3dc7d26a
Marcelo Rivera
authored
47 minutes ago
3dc7d26a
(fix): enforce view flag
· 8b40f609
Marcelo Rivera
authored
46 minutes ago
(fix): show subscription tabs if in requests section
8b40f609
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
9 deletions
+28
-9
flags.ts
src/app/common/services/permissions/flags.ts
+1
-1
channel.component.html
src/app/modules/channels/channel.component.html
+6
-3
channel.component.ts
src/app/modules/channels/channel.component.ts
+5
-0
index.php
src/index.php
+16
-5
No files found.
src/app/common/services/permissions/flags.ts
View file @
8b40f609
...
...
@@ -21,6 +21,6 @@ export enum Flags {
SUBSCRIBE
=
'
subscribe
'
,
TAG
=
'
tag
'
,
REMIND
=
'
remind
'
,
VIEW
=
'
wire
'
,
VIEW
=
'
view
'
,
VOTE
=
'
vote
'
,
}
This diff is collapsed.
Click to expand it.
src/app/modules/channels/channel.component.html
View file @
8b40f609
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/channel.component.ts
View file @
8b40f609
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
src/index.php
View file @
8b40f609
...
...
@@ -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>
This diff is collapsed.
Click to expand it.