* Added functionality to verify user invite tokens and create the initial password
* Add response types
* Fail ValidateCredentialsAsync when user is not approved
* Enable user as part of initial password creating using validation token
* Adds documentation to badrequest and changed nocontent to ok, to align with other APIs
* Fixed tests and added a new one
---------
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
* Add current user data endpoint
* Add Change password endpoint
* Add SetAvatar
* Add get node permissions
* Add endpoint for getting currently logged in users linked logins
* Add tour service
* Add get tours
* Add set tour endpoint
* Added PermissionNames to IReadOnlyUserGroup
* Only require backend auth on management api
* Use ISet in response model
* Fixed issue with saving null as startMediaId, where it was ignored
* Add get current user endpoint
* Fix missing linebreak
* Append "New" keyword to policies
* Update OpenApi
---------
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
* Add current user data endpoint
* Add Change password endpoint
* Add SetAvatar
* Add get node permissions
* Add endpoint for getting currently logged in users linked logins
* Add tour service
* Add get tours
* Add set tour endpoint
* Split permissions endpoint in two, one for media and one for document
* This moves around files and deletes the temp projects with files that are not moved to Core, Infrastructure etc.
Also moves the from new backoffice to static access, and override those with the old views in the legacy executeable
* Removes old files from the new executeable.
* Added missing files
* Added EF Core project to solution file
* fix build
* Add specific not found results
* Add tests for the enable/disable not found tweak
* Cache ids and key in UserIdKeyResolver
* Don't cache null keys
* BackOffice not Backoffice
* Move fetching the user out of the ChangePasswordUsersController
* Move resolving user out of SetAvatar
* Move resolving user out of Update
* Return more specific notfound in bykey
* Use ErrorResult for all endpoints with unknown errors
* Split integration tests
* Add mappers
* Use ?: consistently
* Add reuseable iso code validator
* Validate ISO code
* Update supressions
* Use method from base to get current user key
* Rename ISo to Iso
* Use keys in services instead of user groups + Added a couple of new validations
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Add UserResponseModel
* Add factory to created UserResponseModel
* Add GetByKey controller
* Add GetAllUsers endpoint
* User proper response model
* Make naming consistent
* Order by username in GetAll
* Add user filter endpoint
* Fix includer user states
* Remove gravatar from the backend
* Send user avatars in response
* Add create user model
* start working on create
* Validate the create model
* Add authorization to create
* Use UserRepository instead of UserService to ValidateSessíonId
* Create IBackofficeUserStore interface
This is essentially a core-friendly version of the BackOfficeUserStore, additionally it contains basic methods for managing users, I.E. Get users, save users, create users, etc.
* Remove more usages of user service
* Remove usages of IUserService in BackofficeUserStore
* Add documentation
* Fix tests and DI
* add IBackOfficeUserStoreAccessor to resolve it in singleton services
* Resolve circular dependency
* Remove obsolete constructor
* Add core friendly user manager
* Finish createasync in user service
* Add WIP create endpoint
* Save newly creates users user groups
* Use service scope for user service
* Remove now unnecessary accessors
* Add response types
* Add update user endpoint
* Add EmailUserInviteSender
* Add technology free way of creating confirmation token
* Add invite uri provider
* Add invite user to user service
* Add invite user controller
* Add delete endpoint
* Add operation status responses
* Add operation status responses
* Added temporary file uploads including a repository implementation using local temp folder.
* Add Disable users endpoint
* missing files
* Fixed copy paste error
* Fix create users return type
* Updated OpenApi.json
* Updated OpenApi.json
* Handle if created failed in identity
* Add enable user
* Make users plural in enable/disable
We're doing the operation on multiple entities
* Added file extension check
* Add unlock user endpoint
* Clean up. Removed old TemporaryFileService and UploadFileService and updated dictionary items to use this new items
* Clean up
* Add reset password
* Add UpdateUserGroupsOnUsers method
* Add UpdateUserGroups
* Get rid of stream directly on TemporaryFileModel, and use delegate to open stream instead.
* Fix post merge
* Use keys instead of IDs
* Add ClearAvatar endpoint
* Review changes
* Moved models to their own files
* Reverted launch settings
* Move enlist extension to its own namespace
* Create set avatar endpoint
* Add reponse types
* Remove infrastructure extension after merge
* Add Cmapatibility suppressions
* Add test suppression
* Add integration tests
* Fix issue found in tests
* Add invited user to UserInvitationResult
* Add more tests
* Add update tests
* Hide different tests under parent
* Return DuplicatUserName user operation status if username matches an email
* Add update tests
* Change sorted set to HashSet
It doesn't work if it's not IComparable
* Change ID to Key when checking super
* Add get tests
* Add more GetAllTests
* Move tests to the right namespace
* Add filter test
* Fix including disabled users bug found by test
* Add test to ensure invited user state
* Add test case for UserState.All
* Add more filter tests
* Add enable disable tests
* Add resolver for keys and ids
* Replace usages of IUserService with IUserIdKeyResolver
* Add CompatibilitySuppressions
* Add UserIdKeyResolverTests
* Fix UserIdKeyResolver
* Add missing user operation results
* Updates from review
* ID not key
* Post instead of patch
* Use set instead of params for enable/disable
* Don't call to array
* Use sets for usergroup keys and user keys instead
* LanguageIsoCode instead of Language
* Update CompatibilitySuppressions after changin enumerable to set
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: kjac <kja@umbraco.dk>
* Add MSSQL migration
* Make upgrade possible when user doesn't have a key yet
* Migrate SQLite
* Migrate the external login column
* Fix logging in after migration
* Handle fake GUID correctly
* Make GetByKey async
* Resolve external logins by key instead of id
* Remove usage of naive UserIdToInt
* Dont use ToGuid for property type defaults
* Use constant GUID for user groups
* Ensure that the same GUID is used to create the root user.
* Add migration for two factor logins
* Add default implementations
* Fix unit test
* Remove TODO
* Fix integration tests
* Add default implementation instead of throwing
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Make SQLServer migration idempotent
* Add comment about SQLite
* Fix typo
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Add key to UserGroupDto
* Fix renaming table in sqlite
The SqliteSyntaxProvider needed an overload to use the correct query
* Start work on user group GUID migration
* Add key index to UserGroupDto
* Copy over data when migrating sqlite
* Make sqlite column migration work
* Remove PostMigrations
These should be replaced with Notification usage
* Remove outer scope from Upgrader
* Remove unececary null check
* Add marker base class for migrations
* Enable scopeless migrations
* Remove unnecessary state check
The final state of the migration is no longer necessarily the final state of the plan.
* Extend ExecutedMigrationPlan
* Ensure that MigrationPlanExecutor.Execute always returns a result.
* Always save final state, regardless of errors
* Remove obsolete Execute
* Add Umbraco specific migration notification
* Publish notification after umbraco migration
* Throw the exception that failed a migration after publishing notification
* Handle notification publishing in DatabaseBuilder
* Fix tests
* Remember to complete scope
* Clean up MigrationPlanExecutor
* Run each package migration in a separate scope
* Add PartialMigrationsTests
* Add unhappy path test
* Fix bug shown by test
* Move PartialMigrationsTests into the correct folder
* Comment out refresh cache in data type migration
Need to add this back again as a notification handler or something.
* Start working on a notification test
* Allow migrations to request a cache rebuild
* Set RebuildCache from MigrateDataTypeConfigurations
* Clean MigrationPlanExecutor
* Add comment explaining the need to partial migration success
* Fix tests
* Allow overriding DefinePlan of UmbracoPlan
This is needed to test the DatabaseBuilder
* Fix notification test
* Don't throw exception to be immediately re-caught
* Assert that scopes notification are always published
* Ensure that scopes are created when requested
* Make test classes internal.
It doesn't really matter, but this way it doesn't show up in intellisense
* Add notification handler for clearing cookies
* Add CompatibilitySuppressions
* Use unscoped migration for adding GUID to user group
* Make sqlite migration work
It's really not pretty, square peg, round hole.
* Don't re-enable foreign keys
This will happen automatically next time a connection is started.
* Scope database when using SQLServer
* Don't call complete transaction
* Tidy up a couple of comment
* Only allow scoping the database from UnscopedMigrationBase
* Fix comment
* Remove remark in UnscopedMigrationBase as it's no longer true
* Add keys when creating default user groups
* Map database value from DTO to entity
* Fix migration
Rename also renamed the foreign keys, making it not work
* Make migration idempotent
* Fix unit test
* Update CompatibilitySuppressions.xml
* Add GetUserGroupByKey to UserService
* Add ByKey endpoint
* Add UniqueId to AppendGroupBy
Otherwise MSSQL grenades
* Ensure that languages are returned by PerformGetByQuery
* add POC displaying model
* Clean up by key controller
* Add GetAllEndpoint
* Add delete endpoint
* Use GetKey to get GUID from id
Instead of pulling up the entire entity.
* Add UserGroup2Permission table
* Fetch the new permissions when getting user groups
* Dont ToString int to parse it to a short
I'm pretty sure this is some way old migration type code that doesn't make any sense anymore
* Add new relation to GetDeleteClauses
* Persist the permissions
* Split UserGroupViewModel into multiple models
This is to make it possible to make endpoints more rest-ish
* Bootstrap create and update endpoints
* Make GetAllUserGroupController paged
* Add method to create IUserGroup from UserGroupSaveModel
* Add sanity check version of endpoint
* Fix persisting permissions
* Map section aliases to the name the frontend expects
This is a temporary fix till we find out how we really want to handle this
* Fix up post merge
* Make naming more consistent
* Implement initial update endpoint
* Fix media start node
* Clean name for XSS when mapping to IUserGroup
* Use a set instead of a list for permission names
We don't want dupes
* Make permission column nvarchar max
* Add UserGroupOperationStatuses
* Add IUserGroupAuthorizationService
* Add specific user group creation method to user service
* Move validating and authorizing into its own methods
* Add operation result to action result mapping
* Update create controller to use the create method
* Fix create end point
* Comment out getting current user untill we have auth
* Add usergroup service
* Obsolete usergroup things from IUserService
* Add update to UserGroupService interface
* User IUserGroupService in controllers
* User async notifications overloads
* Move authorize user group creation into its own service
* Add AuthorizeUserGroupUpdate method
* Make new service implementations internal and sealed
* Add update user
* Add GetAll to usergroup service
* Remove or obsolete usages of GetAllUserGroups
* Add usergroup service to DI
* Remove usage of GetGroupsByAlias
* Remove usages of GetUserGroupByAlias
* Remove usage of GetUserGroupById
* Add new table when creating a new database
* Implement Delete
* Add skip and take to getall
* Move skip take into the service
* Fixup suggestions in user group service
* Fixup unit tests
* Allow admins to change user groups they're not a part of
* Add CompatibilitySuppressions
* Update openapi
* Uppdate OpenApi.json
again
* Add missing compatibility suppression
* Added missing type info in ProducesResponseTypeAttribute
* Added INamedEntityViewModel and added on the relevant view models
* Fixed bug, resulting in serialization not being the same as swagger reported. Now all types objects implementing an interface, is serialized with the $type property
* updated OpenApi.json
* Added missing title in notfound response
* Typo
* .Result to .GetAwaiter().GetResult()
* Update comment to mention it should be implemented on CurrentUserController
* Validate that start nodes actually exists
* Handle not found consistently
* Use iso codes instead of ids
* Update OpenAPI
* Automatically infer statuscode in problemdetails
* Ensure that the language exists
* Fix usergroup 2 permission index
* Validate that group name and alias is not too long
* Only return status from validation
We're just returning the same usergroups, and this is less boilerplate code
* Handle empty and null group names
* Remove group prefix from statuses
* Add some basic validation tests
* Don't allow updating a usergroup to having a duplicate alias
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Rename Umbraco.Core namespace to Umbraco.Cms.Core
* Move extension methods in core project to Umbraco.Extensions
* Move extension methods in core project to Umbraco.Extensions
* Rename Umbraco.Examine namespace to Umbraco.Cms.Examine
* Move examine extensions to Umbraco.Extensions namespace
* Reflect changed namespaces in Builder and fix unit tests
* Adjust namespace in Umbraco.ModelsBuilder.Embedded
* Adjust namespace in Umbraco.Persistence.SqlCe
* Adjust namespace in Umbraco.PublishedCache.NuCache
* Align namespaces in Umbraco.Web.BackOffice
* Align namespaces in Umbraco.Web.Common
* Ensure that SqlCeSupport is still enabled after changing the namespace
* Align namespaces in Umbraco.Web.Website
* Align namespaces in Umbraco.Web.UI.NetCore
* Align namespaces in Umbraco.Tests.Common
* Align namespaces in Umbraco.Tests.UnitTests
* Align namespaces in Umbraco.Tests.Integration
* Fix errors caused by changed namespaces
* Fix integration tests
* Undo the Umbraco.Examine.Lucene namespace change
This breaks integration tests on linux, since the namespace wont exists there because it's only used on windows.
* Fix merge
* Fix Merge
Updates the model used to store and retreive permissions, instead of a single string it is an Enumerable<string> which gives us some flexibility in the future and since this was not public (yet) it's the perfect time to do this.
Removes the base Profile classes from User since these are not required, since we cannot share base classes between Member and User, these weren't necessary.