Methods
# assertValidRoleForMethod(userId)
Implementation of assertValidRoleForMethod. Asserts that userId is logged in as an Admin, Advisor or Student. This is used in the define, update, and removeIt Meteor methods associated with each class.
Parameters:
Name | Type | Description |
---|---|---|
userId |
The userId of the logged in user. Can be null or undefined |
If there is no logged in user, or the user is not an Admin or Advisor.
# define(interest, keyword, retired) → {string}
Defines a new interest keyword mapping.
Parameters:
Name | Type | Description |
---|---|---|
interest |
string | the interest slug or id. |
keyword |
string | the keyword. |
retired |
boolean | undefined | optional. |
# dumpOne(docID) → {InterestKeywordDefine}
Returns an object for the InterestKeyword docID in a format acceptable to define().
Parameters:
Name | Type | Description |
---|---|---|
docID |
the id of the pair. |
# getInterestSlugs(keyword) → {Array.<string>}
Returns the interest slugs associated with the given keyword.
Parameters:
Name | Type | Description |
---|---|---|
keyword |
string | the keyword. |
the interest slugs.
# getKeywords(interest) → {Array.<string>}
Returns the keywords associated with the give interest.
Parameters:
Name | Type | Description |
---|---|---|
interest |
the interest slug or id. |
# getUniqueKeywords() → {Array.<string>}
Returns the unique keywords in this collection.
# removeInterest(interest)
Removes all the pairs for the given interest.
Parameters:
Name | Type | Description |
---|---|---|
interest |
string | the interest slug or id. |
# removeIt(docID) → {boolean}
Removes the pair.
Parameters:
Name | Type | Description |
---|---|---|
docID |
string | the id of the pair. |
# removeKeyword(keyword)
Removes all the pairs for the given keyword.
Parameters:
Name | Type | Description |
---|---|---|
keyword |
string | the keyword. |
# update(docID, keyword, retired)
Updates the given interest keyword pair.
Parameters:
Name | Type | Description |
---|---|---|
docID |
the id of the pair. |
|
keyword |
string | undefined | the new keyword, optional. |
retired |
boolean | undefined | the retired status, optional. |