User perms

This commit is contained in:
Jamie.Rees 2016-10-28 17:24:45 +01:00
commit 6d1eef9154
17 changed files with 524 additions and 104 deletions

View file

@ -7,8 +7,9 @@ CREATE TABLE IF NOT EXISTS Users
UserName varchar(50) NOT NULL,
Salt BLOB NOT NULL,
Hash BLOB NOT NULL,
Claims BLOB NOT NULL,
UserProperties BLOB
UserProperties BLOB,
Permissions INTEGER,
Features INTEGER
);
CREATE TABLE IF NOT EXISTS UserLogins

View file

@ -57,12 +57,13 @@ namespace PlexRequests.Store
}
}
public static void AddColumn(this IDbConnection connection, string tableName, string alterType, string newColumn, bool allowNulls, string dataType)
public static void AlterTable(this IDbConnection connection, string tableName, string alterType, string newColumn, bool allowNulls, string dataType)
{
connection.Open();
var result = connection.Query<TableInfo>($"PRAGMA table_info({tableName});");
if (result.Any(x => x.name == newColumn))
{
connection.Close();
return;
}

View file

@ -35,7 +35,10 @@ namespace PlexRequests.Store
{
public byte[] Hash { get; set; }
public byte[] Salt { get; set; }
[Obsolete]
public byte[] Claims { get; set; }
public byte[] UserProperties { get; set; }
public int Permissions { get; set; }
public int Features { get; set; }
}
}