OpenMetaverse.FriendsManager.GrantRights C# (CSharp) Method

GrantRights() public method

Change the rights of a friend avatar.
This method will implicitly set the rights to those passed in the rights parameter.
public GrantRights ( UUID friendID, FriendRights rights ) : void
friendID UUID the of the friend
rights FriendRights the new rights to give the friend
return void
        public void GrantRights(UUID friendID, FriendRights rights)
        {
            GrantUserRightsPacket request = new GrantUserRightsPacket();
            request.AgentData.AgentID = Client.Self.AgentID;
            request.AgentData.SessionID = Client.Self.SessionID;
            request.Rights = new GrantUserRightsPacket.RightsBlock[1];
            request.Rights[0] = new GrantUserRightsPacket.RightsBlock();
            request.Rights[0].AgentRelated = friendID;
            request.Rights[0].RelatedRights = (int)rights;

            Client.Network.SendPacket(request);
        }