Menu

Action Form Notes

Action Form is a module developed by DNNSharp.com for the DNN Content Management System and Development Platform. The developers at LetItShine.biz have used the Action Form module for countless projects and solutions for a number of years. The following is an modest collection of notes that we have started to record about techniques to take advantage of the strengths of this module. We record this here not to become a secondary help system for Action Form users or DNNSharp. But if you can find something here that helps you, that makes us happy too.

Return to the list

HasRole SP

Mark Buelsing 0 0 Article rating: No rating

This stored procedure will return true or false after testing that a userid is in a given role

 

USE [DatabaseName]
GO
/****** Object:  StoredProcedure [dbo].[_LIS_ListArticlesCB]    Script Date: 8/12/2020 8:37:29 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE procedure [dbo].[_LIS_HasRole]

    @UserID int 
    ,@RoleName nvarchar(150) 

AS


    --DECLARE @UserID int = 1
    --DECLARE @RoleName nvarchar(150) = 'Administrators'


    SELECT CAST(CASE WHEN COUNT(*) > 0 THEN 'True' ELSE 'False' END AS nvarchar(10)) AS HasRole
    FROM UserRoles INNER JOIN
    Roles ON UserRoles.RoleID = Roles.RoleID INNER JOIN
    Users ON UserRoles.UserID = Users.UserID
    WHERE Roles.Rolename IN (@RoleName, 'Administrators') AND Users.UserID = @UserID
 

RSS

Welcome Photographers!

We would like to make connections with amateur photographers who would like to see their beautiful images used on the Internet.

If you are interested, leave your name and email and we'll contact you when a particular photo is needed for one of our website projects. If you have a photo that fits the need, then send it to us. At the very least, you will get credit for the photo. Some projects will pay for your photo. It is an opportunity to get your work published!

Thank you

Mark Buelsing