mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 23:48:29 +02:00
Widgets permission: No check required when the user is the creator
This commit is contained in:
@@ -118,9 +118,16 @@ NSString *const kJavascriptSendResponseToPostMessageAPI = @"riotIOS.sendResponse
|
||||
|
||||
- (void)checkWidgetPermissionWithCompletion:(void (^)(BOOL granted))completion
|
||||
{
|
||||
// Check permission in user settings
|
||||
MXSession *session = widget.mxSession;
|
||||
|
||||
if ([widget.widgetEvent.sender isEqualToString:session.myUser.userId])
|
||||
{
|
||||
// No need of more permission check if the user created the widget
|
||||
completion(YES);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check permission in user Riot settings
|
||||
__block RiotSharedSettings *sharedSettings = [[RiotSharedSettings alloc] initWithSession:session];
|
||||
|
||||
WidgetPermission permission = [sharedSettings permissionForWidget:widget];
|
||||
|
||||
Reference in New Issue
Block a user