mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -04:00
Format code
This commit is contained in:
parent
8ee4446b30
commit
ddad768cd8
@ -70,8 +70,14 @@ namespace Kyoo.Authentication
|
|||||||
PermissionOption options =
|
PermissionOption options =
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
Default = _configuration.GetValue("UNLOGGED_PERMISSIONS", "")!.Split(',').Where(x => x.Length > 0).ToArray(),
|
Default = _configuration
|
||||||
NewUser = _configuration.GetValue("DEFAULT_PERMISSIONS", "overall.read,overall.play")!.Split(','),
|
.GetValue("UNLOGGED_PERMISSIONS", "")!
|
||||||
|
.Split(',')
|
||||||
|
.Where(x => x.Length > 0)
|
||||||
|
.ToArray(),
|
||||||
|
NewUser = _configuration
|
||||||
|
.GetValue("DEFAULT_PERMISSIONS", "overall.read,overall.play")!
|
||||||
|
.Split(','),
|
||||||
RequireVerification = _configuration.GetValue(
|
RequireVerification = _configuration.GetValue(
|
||||||
"REQUIRE_ACCOUNT_VERIFICATION",
|
"REQUIRE_ACCOUNT_VERIFICATION",
|
||||||
true
|
true
|
||||||
|
@ -61,7 +61,6 @@ public class UserRepository(
|
|||||||
{
|
{
|
||||||
// If no users exists, the new one will be an admin. Give it every permissions.
|
// If no users exists, the new one will be an admin. Give it every permissions.
|
||||||
if (!await database.Users.AnyAsync())
|
if (!await database.Users.AnyAsync())
|
||||||
|
|
||||||
obj.Permissions = PermissionOption.Admin;
|
obj.Permissions = PermissionOption.Admin;
|
||||||
else if (!options.RequireVerification)
|
else if (!options.RequireVerification)
|
||||||
obj.Permissions = options.NewUser;
|
obj.Permissions = options.NewUser;
|
||||||
|
@ -59,7 +59,8 @@ namespace Kyoo.Tests.Database
|
|||||||
SeasonRepository season = new(_NewContext(), thumbs.Object);
|
SeasonRepository season = new(_NewContext(), thumbs.Object);
|
||||||
LibraryItemRepository libraryItem = new(_NewConnection(), new(null));
|
LibraryItemRepository libraryItem = new(_NewConnection(), new(null));
|
||||||
EpisodeRepository episode = new(_NewContext(), show, thumbs.Object);
|
EpisodeRepository episode = new(_NewContext(), show, thumbs.Object);
|
||||||
UserRepository user = new(_NewContext(), _NewConnection(), new(null), thumbs.Object, new());
|
UserRepository user =
|
||||||
|
new(_NewContext(), _NewConnection(), new(null), thumbs.Object, new());
|
||||||
|
|
||||||
_repositories = new IBaseRepository[]
|
_repositories = new IBaseRepository[]
|
||||||
{
|
{
|
||||||
|
@ -29,5 +29,5 @@ export interface KyooErrors {
|
|||||||
*/
|
*/
|
||||||
errors: string[];
|
errors: string[];
|
||||||
|
|
||||||
status: number | "aborted" | "parse" | "json"
|
status?: number | "aborted" | "parse" | "json";
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,14 @@
|
|||||||
|
|
||||||
import { KyooErrors, useAccount } from "@kyoo/models";
|
import { KyooErrors, useAccount } from "@kyoo/models";
|
||||||
import { P } from "@kyoo/primitives";
|
import { P } from "@kyoo/primitives";
|
||||||
import { ReactElement, createContext, useContext, useEffect, useLayoutEffect, useState } from "react";
|
import {
|
||||||
|
ReactElement,
|
||||||
|
createContext,
|
||||||
|
useContext,
|
||||||
|
useEffect,
|
||||||
|
useLayoutEffect,
|
||||||
|
useState,
|
||||||
|
} from "react";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { useYoshiki } from "yoshiki/native";
|
import { useYoshiki } from "yoshiki/native";
|
||||||
import { PermissionError } from "./unauthorized";
|
import { PermissionError } from "./unauthorized";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user