mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Don't prompt for auth for your own accounts.
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
|
#include "accounts/AccountManager.h"
|
||||||
|
#include "accounts/Account.h"
|
||||||
#include "jobview/AclJobItem.h"
|
#include "jobview/AclJobItem.h"
|
||||||
#include "jobview/JobStatusView.h"
|
#include "jobview/JobStatusView.h"
|
||||||
#include "jobview/JobStatusModel.h"
|
#include "jobview/JobStatusModel.h"
|
||||||
@@ -124,6 +126,25 @@ ACLRegistry::isAuthorizedUser( const QString& dbid, const QString &username, ACL
|
|||||||
//FIXME: Remove when things are working
|
//FIXME: Remove when things are working
|
||||||
// emit aclResult( dbid, username, ACLRegistry::Stream );
|
// emit aclResult( dbid, username, ACLRegistry::Stream );
|
||||||
// return ACLRegistry::NotFound;
|
// return ACLRegistry::NotFound;
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
|
if ( Tomahawk::Accounts::AccountManager::instance() )
|
||||||
|
{
|
||||||
|
Tomahawk::Accounts::AccountManager* accountManager = Tomahawk::Accounts::AccountManager::instance();
|
||||||
|
QList< Tomahawk::Accounts::Account* > accounts = accountManager->accounts();
|
||||||
|
foreach( Tomahawk::Accounts::Account* account, accounts )
|
||||||
|
{
|
||||||
|
QVariantHash credentials = account->credentials();
|
||||||
|
if ( credentials.contains( "username" ) && credentials[ "username" ].toString() == username )
|
||||||
|
{
|
||||||
|
if ( !skipEmission )
|
||||||
|
emit aclResult( dbid, username, ACLRegistry::Stream );
|
||||||
|
return ACLRegistry::Stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
QMutableListIterator< ACLRegistry::User > i( m_cache );
|
QMutableListIterator< ACLRegistry::User > i( m_cache );
|
||||||
while ( i.hasNext() )
|
while ( i.hasNext() )
|
||||||
|
Reference in New Issue
Block a user