Exemplo n.º 1
0
        public virtual void TestAddPermissionToPlayer()
        {
            IPermissionProvider provider = LoadProvider();

            provider.AddPermission(TestPlayer, "DynamicGroupPermission");

            Assert.AreEqual(PermissionResult.Grant, provider.CheckPermission(TestPlayer, "DynamicGroupPermission"));
        }
Exemplo n.º 2
0
 protected override void UpdatePermission(IUser user, IPermissionProvider permissions,
                                          IPermissionEntity target, string permissionToUpdate)
 {
     if (permissions.AddPermission(target, permissionToUpdate))
     {
         user.SendMessage($"Successfully added \"{permissionToUpdate}\" to \"{target.ToString()}\"!",
                          Color.DarkGreen);
     }
     else
     {
         user.SendMessage($"Failed to add \"{permissionToUpdate}\" to \"{target.ToString()}\"!", Color.Red);
     }
 }