This repository has been archived by the owner on Jun 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
[Unity] Permission system #203
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6d6870d
Start on permissions system
stevenvergenz 9786729
Finished permissions APIs and usages
stevenvergenz a1a951d
Implement perms manager in testbed (broken)
stevenvergenz 24c037d
Roll back workaround for user input bug, wait for fix
stevenvergenz 827e68e
Rename permission change event
stevenvergenz 3b2a611
Update all scenes, add perms to MRTK testbed
stevenvergenz ddd27d0
Make sure the permissions enum is futureproof
stevenvergenz ed28d58
RepositoryUri => RepositoryUrl
stevenvergenz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
using MixedRealityExtension.Core; | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MixedRealityExtension.Core | ||
{ | ||
/// <summary> | ||
/// Class containing author-provided metadata about an MRE instance | ||
/// </summary> | ||
public class AppManifest | ||
{ | ||
/// <summary> | ||
/// A human-readable name for this MRE | ||
/// </summary> | ||
public string Name; | ||
|
||
/// <summary> | ||
/// A human readable description of this MRE's behavior | ||
/// </summary> | ||
public string Description; | ||
|
||
/// <summary> | ||
/// The MRE's author name and/or contact information | ||
/// </summary> | ||
public string Author; | ||
|
||
/// <summary> | ||
/// The license for the MRE's source code | ||
/// </summary> | ||
public string License; | ||
|
||
/// <summary> | ||
/// The location of the MRE's public source code | ||
/// </summary> | ||
public string RepositoryUri; | ||
|
||
/// <summary> | ||
/// A list of permissions required for this MRE to run | ||
/// </summary> | ||
public Permissions[] Permissions; | ||
|
||
/// <summary> | ||
/// A list of permissions that this MRE can use, but are not required | ||
/// </summary> | ||
public Permissions[] OptionalPermissions; | ||
|
||
internal static async Task<AppManifest> DownloadManifest(Uri manifestUri) | ||
{ | ||
var webClient = new HttpClient(); | ||
var response = await webClient.GetAsync(manifestUri, HttpCompletionOption.ResponseContentRead); | ||
if (response.IsSuccessStatusCode) | ||
{ | ||
var manifestString = await response.Content.ReadAsStringAsync(); | ||
return JsonConvert.DeserializeObject<AppManifest>(manifestString, Constants.SerializerSettings); | ||
} | ||
else | ||
{ | ||
return new AppManifest(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Url #Resolved