473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Creating a new permission

Hi everyone,

I'm currently trying to create a SecurityPermission schema where I can use
the following attribute:

[assembly:ActivationPermission ("some key", true)]

where the first parameter is some ID key, unique to the application, that I
can use to check if this copy is licensed; and the second parameter
identifies if the software must be registered in order to run. This last one
is to be used with some freeware applications where some features are locked
until registration.

Then, I want to use another atrribute within my code (mostly constructors
and methods):

[ActivationPermission (true)]

Different from the previous usage, this time I use the bool parameter to
tell if I only want to check if the application assembly containt the
attribute (false) or if the application is fully activated (true). So far
I've read enough to create the following constructors (deriving from
CodeAccessSecurityAttribute):

// This is for the assembly version
// The key is used to check the application licensing
public ActivationPermissionAttribute(stirng key, bool required) :
base(required ? SecurityAction.RequestMinimum :
SecurityAction.RequestOptional) {
this.key = key;
}

// This is for the constructor/method version
// Required means that we require the application to be activated;
otherwise
// check only if the assembly (the calling assembly, perhaps) has an
attribute
// with a valid key.
public ActivationPermissionAttribute(bool required) :
base(SecurityAction.Demand) {
this.required = required;
}

I don't know how to go any further on developing the security permissions.
The .NET Documentation is very hard to understand, and I'm not even sure if
I can do this with security permissions. Actualy no care is required over
how the licensing check is performed, only on how can I include it on my
code. Should I divide these into two permissions? Please, can someone help
me?

[]'s,
Harkos
Nov 15 '05 #1
0 905

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pjotr Wedersteers | last post by:
Hi, I am rather new to PHP and a relative newbie to Linux too. I have a webserver at home (Apache 2.0.48 on SuSe 9.0, PHP4). I have some scripts, one of them needs to be able to create logfiles...
8
by: mcmg | last post by:
Hi, I have an asp app that works fine on a windows xp machine but does not work on a windows 2000 server. I have the following code in my global.asa: <OBJECT RUNAT=Server SCOPE=SESSION...
1
by: H?kan Bengtsson via .NET 247 | last post by:
I have written an automation class that connects to an URL, and downloads the content into an ordinary string variable. But when I run my method I get an error saying: Request for the permission...
12
by: Mark | last post by:
Hello, in a simple console application I try to create a file with some code like: FileStream file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new...
1
by: Matt Tapia | last post by:
I want to create several files that will be accessible through the asp.net interface. I can call a stored procedure to create the file on the SQL server, however the asp.net user does not have...
7
by: Jaydeep | last post by:
Hi, Anybody knows how to create virtual directory programmatically under root directory ofcourse from code-behind. I am developing web-based application where I need to create a folder and making...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
1
by: doctorhardik | last post by:
other interesting thing i observe during my work which i describe below: i am using dotproject2.0.4 on fc3. it is working fine. but i want to generate pdf file report during this time i face...
9
by: Tony Proctor | last post by:
I need to create a process Singleton object for an ASP application, but I'm having some odd issues In my GLOBAL.ASA, I have an <OBJECTelement specifying the relevant ProgID with RUNAT=Server and...
0
by: david wright | last post by:
--- On Fri, 9/5/08, srinivasan srinivas <sri_annauni@yahoo.co.inwrote: this appears to be working, what where you expecting? "An upper case "S" means there is no executable permission, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.