mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
implemented dedicated widget for service permission matrix. Permissions are not saved yet, and we also need a default switch
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7898 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
67c98187b6
commit
b2c2b7fc85
14 changed files with 625 additions and 77 deletions
|
@ -1239,6 +1239,29 @@ bool RsServicePermissions::peerHasPermission(const RsPeerId &peerId) const
|
|||
}
|
||||
}
|
||||
|
||||
void RsServicePermissions::setPermission(const RsPeerId& peerId)
|
||||
{
|
||||
std::set<RsPeerId>::const_iterator it;
|
||||
if (mDefaultAllowed)
|
||||
{
|
||||
it = mPeersDenied.find(peerId);
|
||||
mPeersDenied.erase(it) ;
|
||||
}
|
||||
else
|
||||
mPeersAllowed.insert(peerId);
|
||||
}
|
||||
void RsServicePermissions::resetPermission(const RsPeerId& peerId)
|
||||
{
|
||||
std::set<RsPeerId>::const_iterator it;
|
||||
if (!mDefaultAllowed)
|
||||
{
|
||||
it = mPeersAllowed.find(peerId);
|
||||
mPeersAllowed.erase(it) ;
|
||||
}
|
||||
else
|
||||
mPeersDenied.insert(peerId);
|
||||
}
|
||||
|
||||
RsServiceInfo::RsServiceInfo(
|
||||
const uint16_t service_type,
|
||||
const std::string service_name,
|
||||
|
|
|
@ -84,7 +84,10 @@ class RsServicePermissions
|
|||
public:
|
||||
RsServicePermissions();
|
||||
|
||||
bool peerHasPermission(const RsPeerId &peerId) const;
|
||||
bool peerHasPermission(const RsPeerId &peerId) const;
|
||||
|
||||
void setPermission(const RsPeerId& peerId) ;
|
||||
void resetPermission(const RsPeerId& peerId) ;
|
||||
|
||||
uint32_t mServiceId;
|
||||
std::string mServiceName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue