コード例 #1
0
        protected override async Task OnParametersSetAsync()
        {
            Channels = new ChannelsModel(NodeService)
            {
                NodeSearch = new NodeSearch()
                {
                    Module  = Constants.VideosModule,
                    Type    = Constants.ChannelType,
                    OrderBy = new string[]
                    {
                        OrderBy.Weight,
                        OrderBy.Latest,
                        OrderBy.Title
                    }
                }
            };
            await Channels.InitAsync();

            var loggedInUserId = (await AuthenticationStateTask).LoggedInUserId();

            CanAddChannel = await SecurityService.AllowedAsync(
                loggedInUserId,
                null,
                Constants.VideosModule,
                Constants.ChannelType,
                Actions.Add
                );
        }
コード例 #2
0
        protected override async Task OnParametersSetAsync()
        {
            var configSearch = new NodeSearch()
            {
                Module = Constants.VideosModule,
                Type   = Constants.ConfigType
            };
            var configNodes = (await NodeService.GetAsync(configSearch, 0));

            if (configNodes.Length > 0)
            {
                Config = configNodes[0];
            }
            Channels = new ChannelsModel(NodeService)
            {
                NodeSearch = new NodeSearch()
                {
                    Module  = Constants.VideosModule,
                    Type    = Constants.ChannelType,
                    OrderBy = $"{OrderBy.Weight},{OrderBy.Latest},{OrderBy.Title}"
                }
            };
            await Channels.InitAsync();

            var loggedInUserId = (await AuthenticationStateTask).LoggedInUserId();

            CanEditConfig = await SecurityService.AllowedAsync(
                loggedInUserId,
                null,
                Constants.VideosModule,
                Constants.ConfigType,
                Actions.Edit
                );

            CanAddChannel = await SecurityService.AllowedAsync(
                loggedInUserId,
                null,
                Constants.VideosModule,
                Constants.ChannelType,
                Actions.Add
                );
        }