mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
feat(ocp): expose whether talk is enabled for user
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
This commit is contained in:
parent
836546414e
commit
950a3f8d37
3 changed files with 64 additions and 0 deletions
|
|
@ -91,4 +91,20 @@ class Broker implements IBroker {
|
|||
|
||||
$this->backend->deleteConversation($id);
|
||||
}
|
||||
|
||||
public function isDisabledForUser(): bool {
|
||||
if (!$this->hasBackend()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->backend->isDisabledForUser();
|
||||
}
|
||||
|
||||
public function isNotAllowedToCreateConversations(): bool {
|
||||
if (!$this->hasBackend()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->backend->isNotAllowedToCreateConversations();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,28 @@ interface IBroker {
|
|||
* @since 26.0.0
|
||||
*/
|
||||
public function deleteConversation(string $id): void;
|
||||
|
||||
/**
|
||||
* Check if the logged in user is not allowed to create conversations,
|
||||
* respecting the per-group restrictions configured in Talk admin settings
|
||||
* (allowed_groups).
|
||||
*
|
||||
* Returns false when Talk is not available at all.
|
||||
*
|
||||
* @return bool
|
||||
* @since 34.0.0
|
||||
*/
|
||||
public function isNotAllowedToCreateConversations(): bool;
|
||||
|
||||
/**
|
||||
* Check if Talk is disabled for the logged in user, respecting the
|
||||
* per-group restriction configured in Talk admin settings
|
||||
* (start_conversations).
|
||||
*
|
||||
* Returns false when Talk is not available at all.
|
||||
*
|
||||
* @return bool
|
||||
* @since 34.0.0
|
||||
*/
|
||||
public function isDisabledForUser(): bool;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,4 +42,28 @@ interface ITalkBackend {
|
|||
* @since 26.0.0
|
||||
*/
|
||||
public function deleteConversation(string $id): void;
|
||||
|
||||
/**
|
||||
* Check if the logged in user is not allowed to create conversations,
|
||||
* respecting the per-group restrictions configured in Talk admin settings
|
||||
* (allowed_groups).
|
||||
*
|
||||
* Returns false when Talk is not available at all.
|
||||
*
|
||||
* @return bool
|
||||
* @since 34.0.0
|
||||
*/
|
||||
public function isNotAllowedToCreateConversations(): bool;
|
||||
|
||||
/**
|
||||
* Check if Talk is disabled for the logged in user, respecting the
|
||||
* per-group restriction configured in Talk admin settings
|
||||
* (start_conversations).
|
||||
*
|
||||
* Returns false when Talk is not available at all.
|
||||
*
|
||||
* @return bool
|
||||
* @since 34.0.0
|
||||
*/
|
||||
public function isDisabledForUser(): bool;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue