Пример #1
0
        public static Task <AuthOpen> PreauthorizeAsync(
            XamCore.Security.AuthorizationEnvironment environment,
            string path,
            uint mode   = 0,
            bool create = true)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            return(Task.Run(() => Preauthorize(environment, path, mode, create)));
        }
Пример #2
0
        public static AuthOpen Preauthorize(
            XamCore.Security.AuthorizationEnvironment environment,
            string path,
            uint mode   = 0,
            bool create = true)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            return(new AuthOpen(
                       XamCore.Security.Authorization.Create(
                           new XamCore.Security.AuthorizationRights {
                { "sys.openfile.readwrite" + (create ? "create" : "") + "." + path }
            },
                           environment,
                           InteractionAllowed | ExtendRights | PreAuthorize),
                       path,
                       mode,
                       create));
        }