logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Tom Van Overbeke  
#1 Posted : Thursday, November 7, 2019 1:59:08 PM(UTC)
Tom Van Overbeke

Rank: Member

Groups: Registered
Joined: 10/23/2019(UTC)
Posts: 11
Belgium

Hi,

I am really struggling with the security aspect of Seal Report (me not being a programmer...)
I've managed to have a very basic setup with 1 user, using this setting:

Security Provider: Basic Authentication
Use custom security script: True:

and the contents of the custom security script (see below).
But truth is, I have no idea how it works. When I change e.g. Model to Model2, I get a syntax error warning, which makes me think that Model is a reserved word.
I've not found a post in this forum so far with a clear example of such a basic setup.

What I am looking for, is a way to have 2 or 3 users with their own login, who can have access to all the reports.

Thanks,
Tom


Quote:
@using Seal.Model
@using Seal.Helpers
@{
SecurityUser user = Model;
//Basic authentication script: use the user name and password to authenticate the user and set his name and security groups...
//user.WebUserName -> user name from the login screen
//user.WebPassword -> password from the login screen

// user.Name = user.WebUserName; //Display name
Model.Name = user.WebUserName; //Display name

//user.PersonalFolderName -> may be set to defined the personal folder name

//security check can be hardcoded
if (user.WebUserName == "Model" && user.WebPassword == "Lat741")
{
user.AddDefaultSecurityGroup();
//user.AddSecurityGroup("aGroupName");
}
else {
throw new Exception("Invalid user name or password");
}
}


epf  
#2 Posted : Thursday, November 7, 2019 2:44:25 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Can you try:
Code:
if (user.WebUserName == "userName1" && user.WebPassword == "pwd1")
{
  user.AddDefaultSecurityGroup();
}
else if (user.WebUserName == "userName2" && user.WebPassword == "pwd2")
{
  user.AddDefaultSecurityGroup();
}
else if (user.WebUserName == "userName3" && user.WebPassword == "pwd3")
{
  user.AddDefaultSecurityGroup();
}
else {
  throw new Exception("Invalid user name or password");
}
danni95  
#3 Posted : Wednesday, February 7, 2024 2:48:46 PM(UTC)
danni95

Rank: Newbie

Groups: Registered
Joined: 2/7/2024(UTC)
Posts: 1
Woman
India
Location: INDIA

Implementing basic security measures, like strong passwords, regular software updates, and enabling two-factor authentication, forms a fundamental defense against cyber threats. These simple yet effective practices create a robust foundation, enhancing overall digital safety and minimizing vulnerabilities in an increasingly interconnected and dynamic online environment.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.