public static PermissionPlugin getInstance() { if (instance == null) { instance = new PermissionPlugin(); } return(instance); }
public void UserGroups() { Mock<User> user = CreateUser(); var plugin = new PermissionPlugin(); string testGroup = "hello.world"; plugin.SetGroup(user.Object, testGroup); string group = plugin.GetGroup(user.Object); Assert.AreEqual(testGroup, group); }
private IEnumerator Start() { bool isCheckSuccess = false; yield return(PermissionPlugin.Check(PermissionType.Location, result => isCheckSuccess = result)); if (isCheckSuccess) { _log += "Use of the camera is permitted.\n"; } else { _log += "Open permission dialog\n"; PermissionPlugin.Open(PermissionType.Camera); } }
public static bool CheckPermission(this ReferenceHub rh, string permission) => rh.gameObject == PlayerManager.localPlayer || PermissionPlugin.CheckPermission(rh, permission);