Merge pull request #649 from mc-server/GroupsPermissions
Removed deprecated HasCommand function
This commit is contained in:
commit
cd634ea138
@ -1267,19 +1267,6 @@ void cPlayer::RemoveFromGroup( const AString & a_GroupName )
|
||||
|
||||
|
||||
|
||||
bool cPlayer::CanUseCommand( const AString & a_Command )
|
||||
{
|
||||
for( GroupList::iterator itr = m_Groups.begin(); itr != m_Groups.end(); ++itr )
|
||||
{
|
||||
if( (*itr)->HasCommand( a_Command ) ) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cPlayer::HasPermission(const AString & a_Permission)
|
||||
{
|
||||
if (a_Permission.empty())
|
||||
|
@ -211,7 +211,6 @@ public:
|
||||
/// Removes a player from the group, resolves permissions and group inheritance (case sensitive)
|
||||
void RemoveFromGroup( const AString & a_GroupName ); // tolua_export
|
||||
|
||||
bool CanUseCommand( const AString & a_Command ); // tolua_export
|
||||
bool HasPermission( const AString & a_Permission ); // tolua_export
|
||||
const GroupList & GetGroups() { return m_Groups; } // >> EXPORTED IN MANUALBINDINGS <<
|
||||
StringList GetResolvedPermissions(); // >> EXPORTED IN MANUALBINDINGS <<
|
||||
|
@ -25,26 +25,6 @@ void cGroup::AddPermission( AString a_Permission )
|
||||
|
||||
|
||||
|
||||
bool cGroup::HasCommand( AString a_Command )
|
||||
{
|
||||
if( m_Commands.find("*") != m_Commands.end() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CommandMap::iterator itr = m_Commands.find( a_Command );
|
||||
if( itr != m_Commands.end() )
|
||||
{
|
||||
if( itr->second ) return true;
|
||||
}
|
||||
|
||||
for( GroupList::iterator itr = m_Inherits.begin(); itr != m_Inherits.end(); ++itr )
|
||||
{
|
||||
if( (*itr)->HasCommand( a_Command ) ) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void cGroup::InheritFrom( cGroup* a_Group )
|
||||
{
|
||||
m_Inherits.remove( a_Group );
|
||||
@ -54,6 +34,7 @@ void cGroup::InheritFrom( cGroup* a_Group )
|
||||
|
||||
|
||||
|
||||
|
||||
void cGroup::ClearPermission()
|
||||
{
|
||||
m_Permissions.clear();
|
||||
|
@ -18,8 +18,6 @@ public: // tolua_export
|
||||
void AddPermission( AString a_Permission ); // tolua_export
|
||||
void InheritFrom( cGroup* a_Group ); // tolua_export
|
||||
|
||||
bool HasCommand( AString a_Command ); // tolua_export
|
||||
|
||||
typedef std::map< AString, bool > PermissionMap;
|
||||
const PermissionMap & GetPermissions() const { return m_Permissions; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user