Represents the permissions of a set of subjects.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public interface IPermission
Public Interface IPermission
public interface class IPermission
Members
All Members | Properties | ||||
Icon | Member | Description |
---|---|---|
InstrumentField |
Gets or sets the instrument field.
| |
ReadAllowed |
Gets or sets a value indicating whether the user can read subjects matching SubjectPattern.
| |
SubjectPattern |
Gets or sets a regular expression representing the subjects that should have
the permissions defined by this IPermission.
| |
TradeAllowed |
Gets or sets a value indicating whether the user can trade on subjects matching SubjectPattern.
| |
WriteAllowed |
Gets or sets a value indicating whether the user can contribute to (publish to)
subjects matching SubjectPattern.
|
Remarks
The permissioning system can control read and write access to subjects selected by the specified SubjectPattern.
Within the Caplin Xaqua environment there is a dedicated trade channel (subject) per asset class, for each user. If the trade channel subject is within the ^/TRADE/FX namespace and you wish to permit trading for the user on subjects within the ^/FX/ namespace, then the permissions should be configured as follows:
SubjectPattern | ReadAllowed | WriteAllowed | TradeAllowed | InstrumentField |
^/TRADE/FX | true | true | false | Instrument |
^/FX | true | false | true | null |
Examples
This example shows how to add permissions so that trading is permitted on the ^/FX namespace.
CopyC#
using System; using System.Collections.Generic; using System.Text; using Caplin.KeyMaster.Permissioning; namespace KeyMasterSnippets.Permissioning { public class ExampleFXTradingPermissions { public IUserPermissions CreateStandardFXPermissions() { // Create an empty permission set. IUserPermissions userPerms = new UserPermissions(); // Add in read and trading access for FX userPerms.AddPermission(new Permission("^/FX", true, false, true)); // Now add in permissions for the trade channel. // For trading to work, the StreamLink client should contribute a field called "TradingInstrument" // containing a subject under /FX // When using a trade channel subject, the subject must have read and write permissions. userPerms.AddPermission(new Permission("^/TRADE/FX", true, true, false, "TradingInstrument")); return userPerms; } } }